Search files containing certain text but not certain other text

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Search files containing certain text but not certain other text

Post by *wanderer »

I wish to find files containing a text but not a specific variation of it. I've tried playing with the Find Files dialog (i'm not sure if regex is supported in the Find Text field) without luck. I also tried Everything but couldn't make it work either. Can someone please help?

Example of what i'm trying to achieve:

Find files containing text "<LINK>" but not "<LINK>Properties"
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
white
Power Member
Power Member
Posts: 5748
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Search files containing certain text but not certain other text

Post by *white »

Find text:

Code: Select all

<LINK>(?!Properties)
[X] RegEx (2)
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Search files containing certain text but not certain other text

Post by *wanderer »

Great, thanks! I was trying to use subexpressions but it seems i was doing something wrong.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
white
Power Member
Power Member
Posts: 5748
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Search files containing certain text but not certain other text

Post by *white »

Be aware that the used regex library by TC has a limitation that a look ahead assertion must be at the end of the regular expression (and a look behind assertion must be at the start).
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Search files containing certain text but not certain other text

Post by *wanderer »

Ok, thanks again for the info.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: Search files containing certain text but not certain other text

Post by *tuska »

2wanderer

Just out of interest:
Does this query also work in Everything 1.5a?

Code: Select all

"Path" content*:<LINK>
; Operator: < > Grouping
; Use a * before the : to treat the rest of the search as the value:
Post Reply