Is it possible to combine multiple regular expressions using Boolean AND, OR operators

0 votes

I use FileLocator Pro to search against a JobLog of run time output such as job started, job ended, elapsed time etc. Currently I need to execute three different regular expression searches for each row I want but is there a way to perform the three searches in a single search?

Ideally I'd like to these 3 different "reg exp strings" in a txt file and the criteria then picked up from reading this criteria file. Is that possible?

asked Feb 12, 2016 by dave (52,970 points)

1 Answer

0 votes

You can combine multiple regular expressions using the Boolean search REGEX operator, e.g.

REGEX "reg.*ex1" OR REGEX "reg.*ex2" OR REGEX "reg.*ex3"

Alternatively if you specify Boolean RegEx for your search type the REGEX operator is implied for each term. If the expression is to be evaluated on a Line by Line basis you can change this option in the Options Tab.

File Lists

To load criteria from a file use the File List functionality. For example if you created a text file MyRegex.txt with the three lines:

REGEX "reg.*ex1" 
REGEX "reg.*ex2" 
REGEX "reg.*ex3"

Then ran the search as:

File name:       *.log
Containing Text: =C:\MyRegex.txt
Look In:         C:\Log\Folder

It would be the equivalent of the first search. See this QA article for more information:

QA: How can I search a list of keywords inside files?

answered Feb 12, 2016 by dave (52,970 points)
...