Find multiple regexp

Tool for Search and Replace across multiple files.
Post Reply
User avatar
SilentGuy

Find multiple regexp

Post by SilentGuy »

Hi!
I often use textcrawler to just classify lots of text files. This often involves searches like this "Files that match regexp1 and regexp2"
I've found two ways to do this and the both have advantages and disadvantages.
My first approach was to match regexp1 mark all files and then use regexp2 with "in marked files". This works fine, but you don't see how the file matched regexp1 in the preview.
The other way I wound was to try to build a regexp that includes both regexp, but this regexp also matched all characters in between which is bad for the memory and the preview.

I'm not certain which seems to be the best way to get this to work, either have the ability to "remember" what was highlighted before running another search, or a way to express that I don't care about a character, but I think that would be a really big and weird change in the regexp engine...
User avatar
Fool4UAnyway

Post by Fool4UAnyway »

You could:
- run a first find process searching for regex 1
- mark the matching files only
- run a second find process searching for regex 2
- mark the matching files only
- run a third find process searching for ( regex 1 or regex 2)

Example: wanted files with 123 and ABC
- Find: 123
- Mark: 123
- Find: ABC
- Mark: 123 and ABC (= unmark 123 and not ABC)
- Find: 123|ABC
User avatar
SilentGuy

Post by SilentGuy »

Doh, you are right, that works. Thanks! Gues I hadn't thought it completely through :)
Post Reply