lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ba3 <>
Subject Multiline Regex with Lucene
Date Sun, 26 Jul 2009 13:52:37 GMT

I was trying to do a regex search with the lucene and
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 :  [with the multi
line checked]
In lucene though there are no hits. Can you please point me in the right

-- Rgds

Regex :
hello.*(\r[^#]*)This is to be searched.*(\r[^#]*)#

Content :
hello world
This is to be searched
Test line should not be selected
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
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message