Using Regex in the Find Files box

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
Andante
Junior Member
Junior Member
Posts: 41
Joined: 2018-01-31, 01:38 UTC

Using Regex in the Find Files box

Post by *Andante » 2019-09-02, 22:46 UTC

How can I specify a reverse search in the "Search for" field?

That is, I'd like to find all files that do NOT begin with a P.

User avatar
Dalai
Power Member
Power Member
Posts: 6701
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Using Regex in the Find Files box

Post by *Dalai » 2019-09-02, 23:19 UTC

Search for:

Code: Select all

^[^P]
[X] RegEx

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

Andante
Junior Member
Junior Member
Posts: 41
Joined: 2018-01-31, 01:38 UTC

Re: Using Regex in the Find Files box

Post by *Andante » 2019-09-03, 01:05 UTC

Wonderful, Dalai, thanks. It worked like a charm.

Can you explain what the ^ and the [ ] indicate?

User avatar
petermad
Power Member
Power Member
Posts: 8518
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Using Regex in the Find Files box

Post by *petermad » 2019-09-03, 02:47 UTC

You could also just use this in the "Search for:" field (without RegEx):

Code: Select all

*|P*
Meaning: look for all files (*), but not (|), files that start with a P (P*)


^[^P] means: in the start (^), look for a character ([]), which is not P (^P)
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

Andante
Junior Member
Junior Member
Posts: 41
Joined: 2018-01-31, 01:38 UTC

Re: Using Regex in the Find Files box

Post by *Andante » 2019-09-03, 21:01 UTC

Thanks, Peter, that's even better. I was hoping to specify a particular type of extension, and this enables me to do so.

So in the future, I can use a vertical bar to specify "not"?

User avatar
Dalai
Power Member
Power Member
Posts: 6701
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Using Regex in the Find Files box

Post by *Dalai » 2019-09-03, 21:54 UTC

Andante wrote:
2019-09-03, 21:01 UTC
So in the future, I can use a vertical bar to specify "not"?
Yes. This is also mentioned in the TC help, in the topic "Find files".

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

Post Reply