Search in files/folders for files containing two strings using regular expressions

Discussion, questions and support.
Post Reply
Message
Author
daredan
Posts: 2
Joined: 13.09.2017, 10:16

Search in files/folders for files containing two strings using regular expressions

#1 Post by daredan » 13.09.2017, 10:36

Hi,

I have been googling through different forums to find out on how I can find two strings in containing text in a list of data files.

It's apparently fairly easy to find them with the OR function as this is merely done with a |, eg (String1|String2).
However I want to find only files which contain both strings in them, but the AND function seems to be more complex to set up as regular expression. I have found examples (eg https://stackoverflow.com/questions/469 ... d-operator) mentioning that (?=String1)(?=String2) should work at least in Perl/Java, but I couldn't make it work in FreeCommander.

Which brings me back to the original question: How to find files which contain two specific strings using regular expressions?

Thanks in advance.

afh
Posts: 72
Joined: 30.06.2014, 18:50
Location: Romania

Re: Search in files/folders for files containing two strings using regular expressions

#2 Post by afh » 16.09.2017, 13:30

(String1|String2).*(String1|String2) should work...

daredan
Posts: 2
Joined: 13.09.2017, 10:16

Re: Search in files/folders for files containing two strings using regular expressions

#3 Post by daredan » 18.09.2017, 15:04

Thanks for the reply. Unfortunately I couldn't make it work as the pic illustrates. https://imgur.com/a/ckHAW

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest