Page 1 of 1
Regular Expression Help
Posted: Wed Feb 27, 2002 7:45 pm
by Mauri Piper
I would like to use "Find in Files" to locate all the files that contain one word or phrase and another word or phrase. I have combed the Help files on how to use regular expressions and no doubt I have stared right at it and missed it, but how do I do this?
I'd also like to be able to mark or replace lines that contain one or more target words or phrases.
Mauri
Re: Regular Expression Help
Posted: Wed Feb 27, 2002 9:32 pm
by Mark Schnitzius
Just search for
wordone\|wordtwo
in files with "Regular Expression" checked. You can click "Mark All" instead of "Find" to mark those lines that match.
You won't be able to replace/remove the whole line because you won't be able to match on the whole line -- you can't search across files for a carriage return (\n). You might be able to swing it with a macro though.
Re: Regular Expression Help
Posted: Wed Feb 27, 2002 10:27 pm
by Mauri Piper
Thanks, Mark. That works great to find the files that have either word. Is there a way to find only the files that have both words?
Apologies in advance if you already answered this and I just missed it.
~Mauri
Re: Regular Expression Help
Posted: Thu Feb 28, 2002 11:54 am
by Andreas
AFAIK not in one go.
Close all files.
Search in Files for the first word.
Open All
Now you have all files containing the first word.
Search for the second word, set the scope to "All Documents"
Re: Regular Expression Help
Posted: Sat Mar 02, 2002 7:23 am
by Mauri Piper
Thanks you for your help, Andreas and Mark
~Mauri