I am wanting to do a search for a line which contains the character strings “AAA” *AND* “BBB”.
I am wanting to do a search for a line which contains the character strings “AAA” *OR* “BBB”.
I am not a good CMAC author at all. Are these searches something that MEW can already do, or does someone have a macro already which does these?
Thanking you all in advance for the assistance.
If all you want to do is a search, you don’t need a macro. Regular Expressions will do what you want. To enable a regular expression search, click on that radio button in the Type option of the Find dialog.
OR searching is a little easier: To search for AAA or BBB, enter: (AAA)|(BBB)
In the Search for box. In regular expressions, the pipe character means OR and the parenthesis group the characters into strings. Most of the time you don’t need the parentheses and you can simplify the search string to: AAA|BBB
AND searching is a little more complicated because order matters. To search for AAA and BBB IN THAT ORDER, search for: AAA.*BBB
This uses the regular expression idiom “.*” which means any character (“.”) repeated 0 or more times (“*”).
To search for AAA and BBB in EITHER order, search for: (AAA.*BBB)|(BBB.*AAA)
You may notice that this uses the OR construct described earlier (AAA followed by BBB OR BBB followed by AAA). While the parentheses aren’t necessary, I use them to make the expression easier to read.