Just use the UAX29URLEmailTokenizerFactory, which recognizes email
addresses.
Any particular reason that you're trying to reinvent the wheel?
-- Jack Krupansky
-----Original Message-----
From: Luis Cappa Banda
Sent: Tuesday, July 30, 2013 10:53 AM
To: solr-user@lucene.apache.org
Subject: Email regular expression.
Hello everyone!
Unfortunately I have to search all E-mail addresses found in a text field
from each document. I've been reading for a while how to use RegExp's in
Solr, but after trying some of them they didn't work. I've noticed that
Lucene RegExp syntax sometimes is very different from the classic RegExp
syntax, so that may be the reason why they didn't work for me, and maybe
someone more expert can help me.
The syntax is the following:
*E-mail: *
text:/[a-z0-9_\|-]+(\.[a-z0-9_\|-]|)*@[a-z0-9-]|(\.[a-z0-9-]|)*\.([a-z]{2,4})/
Thank you very much in advance!
Best regards,
--
- Luis Cappa