How to use regex to match all except (a pattern)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
znotft
Junior Member
Junior Member
Posts: 6
Joined: 2010-01-16, 20:47 UTC

How to use regex to match all except (a pattern)

Post by *znotft »

Hi,

I wonder if there is way to match all except (pattern)? It should be a really simple thing, however, I searched the internet and find people are talking about look ahead assertion and perl for this simple thing. Anyone know a simple trigger to do this?

Thanks a lot.
User avatar
dindog
Senior Member
Senior Member
Posts: 316
Joined: 2010-10-18, 07:41 UTC

Post by *dindog »

I can't figure a easy way to achieve that... and even regex can, TC could, and should enhance the search files part, adding EXCLUDE pattern, as well as search base on the previous result.

like google search, we do match searching most of the time, but exclude also needed now and then
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

You may use QuickSearch eXtended. There is a RegEx search and you may negate the result easily.

However this only works in the current folder.
If you want to search subfolders use "ctrl+b".
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

znotft
Depends on which function you are talking about. For searching files there is possibility to use negated regex search in the Plugins tab.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

@Flint,
What do you mean? The only regex plugin I know of is regex.wdx --- and it's function is to rename columns/fields (e.g. MRT). Which would be grand if the plugin allowed you to define multiple "results" in it's ini file - but it doesn't. Each separate result needs to be in a copy of the plugin installed in it's own folder :: extremely clunky.

So how would you apply a non-renaming regex from the plugins section?
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Balderstrom
I mean that the topicstarter did not specify what he is trying to do with negative regexp matching. So I pointed that TC implements this functionality for searching with plugins. If you select any plugin field with string type, the OP combobox will contain operations regex and !regex for positive and negative matching of the field value to the expression user specified in the Value box.

For example, if you wish to search some files with names matched by expression ^total.*\.(exe|inc)$, you can either enter this expression in the Search for field of the General page, or create a rule on the Plugins page (tc.fullname, regex, expression). But if you wish to find files that are not matched by this expression, you cannot do it on the General page, but there is still possibility to do it on the Plugins page, by just using !regex instead of regex.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
dindog
Senior Member
Senior Member
Posts: 316
Joined: 2010-10-18, 07:41 UTC

Post by *dindog »

Flint wrote: you cannot do it on the General page, but there is still possibility to do it on the Plugins page, by just using !regex instead of regex.
thumb up. :wink:

though I still believe TC should have a simple exclude field in General page
Post Reply