Full-blown Regex engine needed

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
digitaldog4
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-28, 23:33 UTC

Full-blown Regex engine needed

Post by *digitaldog4 »

Hi!

I appreciate that Total Commander has some Regex capabilities in various places, but today I run into an issue. I needed to search a pretty deep hierarchy of directories for a files with specific string. There was mix of source and binary files that matched. So I thought I can filter out binaries by just specifying the following regex in "Search in" textbox:
\.(?!dll|exe|cache)$
(look for any file which has a dot NOT FOLLOWED by any of the given extensions).

But it didn't work, it turned out that Total Commander doesn't support so-called "negative lookahead assertions".

So please either help me how can I complete similar tasks in the future, or possibly plan for inclusion of a full blown regex engine in TC. I noticed that basic syntax is (fortunately) similar to the one used by .NET / JavaScript / PCRE (which have the advanced features), so replacing this builtin engine with the one to offer full capabilities would not break anything.

Thanks!
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

You could utilize the TC NOT operator "|"



Look for any file which has NOT any of the given extensions: dll|exe|cache

Search for: [  |*.dll *.exe *.cache ]



Look for any file with "mystring" in name which has NOT any of the given extensions: dll|exe|cache

Search for: [  *mystring*|*.dll *.exe *.cache ]





Press F1-key while in Find dialog to read more about.



 
chojrak11
Junior Member
Junior Member
Posts: 7
Joined: 2009-04-26, 10:52 UTC

Post by *chojrak11 »

Stefan2 wrote:You could utilize the TC NOT operator "|"
Hoh, /me stupid... Thanks for the tip, and sorry for dumb post. I'll RTFM.
Thank you!
Post Reply