Page 1 of 1

regex AND operator?

Posted: Wed Oct 08, 2014 4:09 pm
by MMPDavidL
I'm trying to search using TextCrawler for files that contain both phrases. For example, only if 'EMPLOYEE HEALTH,MMMC' is found, AND,' CHEST PA & LATERAL' is found. I tried using a pipe (|), but it appears that is more like an OR than an AND. Thanks for any help.

Re: regex AND operator?

Posted: Thu Oct 16, 2014 11:46 am
by DigitalVolcano
ANDs are tricky with regular expresssions.

You can use positive lookaheads:

Code: Select all

(?=.*phrase)(?=.*anotherphrase)
It might be a little slow on larger files.