lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven A Rowe <sar...@syr.edu>
Subject RE: Multiline Regex with Lucene
Date Mon, 27 Jul 2009 17:05:46 GMT
Hi ba3,

What analyzer did you use when indexing the content field?

Steve

> -----Original Message-----
> From: ba3 [mailto:sbadhrinath@gmail.com]
> Sent: Sunday, July 26, 2009 9:53 AM
> To: java-user@lucene.apache.org
> Subject: Multiline Regex with Lucene
> 
> 
> I was trying to do a regex search with the lucene and
> JavaUtilRegexCapabilities.
> The code used is :
> RegexQuery query = new RegexQuery(new
> Term("contents","(?m)hello.*(\r[^#]*)This is to be
> searched.*(\r[^#]*)#"));
> query.setRegexImplementation(new JavaUtilRegexCapabilities());
> 
> I verified the regex in : http://www.gskinner.com/RegExr/  [with the
> multi line checked]
> In lucene though there are no hits. Can you please point me in the
> right direction
> 
> -- Rgds
> Ba3
> 
> Regex :
> hello.*(\r[^#]*)This is to be searched.*(\r[^#]*)#
> 
> Content :
> hello world
> This is to be searched
> #
> Test line should not be selected
> hello
> This should not work
> some other lines
> #
> Not to be selected
> hello world
> Some lines
> This is to be searched
> Some lines
> #
> hello earth
> some lines
> #


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message