Invert (exclude) complex regex expression

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
user743
Junior Member
Junior Member
Posts: 2
Joined: 2023-07-21, 04:45 UTC

Invert (exclude) complex regex expression

Post by *user743 »

Hello all!

For a long time I used simple saved search for filter-out (main menu Show->Custom...) various unimportant and temporary files in Total Commander panels:

Code: Select all

|*.bak *.*$* *.log *.cdc *.adt *.wbk *.err *.~lir *.~~lir *.~jnt *.tmp sync.ffs_db
Now I began to use the program, that saves backup copies of workin file in that manner:

Code: Select all

fname.rvt
fname.0001.rvt
fname.0002.rvt
fname.0003.rvt
and so on, where fname.rvt is a working copy of file, and others - backups. The extension may also be rfa, not only rvt. I want to filter-out this backups too.

I realized, that it impossible to do with wildcards (am I right?). Then I construct Regex for find this new type of files:

Code: Select all

.\.\d{4}\.(rvt|rfa)
, convert wildcard string to Regex, and combine them together:

Code: Select all

.\.(bak|log|cdc|adt|wbk|err|tmp|~lir|~~lir|~jnt)|sync\.ffs_db|.\.\d{4}\.(rvt|rfa)
What I am unable to do is invert this regex expression so that it excludes the found names from the result so I can use it for hiding this files (main menu Show->Custom...).

Could someone help me with this please?
User avatar
white
Power Member
Power Member
Posts: 5807
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Invert (exclude) complex regex expression

Post by *white »

Click the Define button, then click the Plugins tab and utilize the !regex operator.
user743
Junior Member
Junior Member
Posts: 2
Joined: 2023-07-21, 04:45 UTC

Re: Invert (exclude) complex regex expression

Post by *user743 »

Thank you, white! It works for me!
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Invert (exclude) complex regex expression

Post by *petermad »

2user743
I realized, that it impossible to do with wildcards (am I right?).

Code: Select all

|*.*.rvt
seems to work fine to filter fname.0001.rvt but stiil show fname.rvt
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply