FAQ
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
#
--
View this message in context: http://www.nabble.com/Multiline-Regex-with-Lucene-tp24667109p24667109.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 13 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedJul 26, '09 at 1:52p
activeJul 29, '09 at 5:14p
posts13
users5
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase