regex AND operator?

A place to try and solve your RegEx problems.
Post Reply
MMPDavidL
Posts: 1
Joined: Wed Oct 08, 2014 4:05 pm

regex AND operator?

Post 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.
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: regex AND operator?

Post 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.
Post Reply