Regex syntax in TC versus Everything

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Regex syntax in TC versus Everything

Post by *nsp »

If i want to find all file that start by ABC or BCD, I use the folowing regexp expression

Code: Select all

^(ABC|BCD)
This work fine with TC search but if i tick Everything i do not get correct result.
I can get good result if i use this expression :

Code: Select all

ed:regex:"^(ABC|BCD)"
I added double quote for the regexp expression to work.

--- By mistake I've created the initial post in wrong topic https://www.ghisler.ch/board/viewtopic.php?f=16&t=50475
User avatar
tuska
Power Member
Power Member
Posts: 3740
Joined: 2007-05-21, 12:17 UTC

Re: Regex syntax in TC versus Everything

Post by *tuska »

On the basis of the title, I would like to add the following, namely
the two previous examples work the same way in "Everything" as well:

Code: Select all

! ----------------------------------------------------------------------!
! Input line          ! Option in "Everything"                          !
! --------------------!-------------------------------------------------!
! ^(ABC|BCD)          ! "REGEX" must be enabled (Search > Enable Regex) !
! regex:"^(ABC|BCD)"  ! "REGEX" NOT enabled!                            !
! --------------------!-------------------------------------------------!
(Besides "REGEX" there are other options, like Match Case, Match Whole Word, Match Path, Match Diacritics ...)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Regex syntax in TC versus Everything

Post by *ghisler(Author) »

Thanks, it only seems to affect certain regular expressions - for example ^ABC works here.

Edit: I found the problem: TC sends the request to Everything like this:
regex:^(ABC|BCD)
but appearently Everything needs it quoted:
regex:"^(ABC|BCD)"
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Regex syntax in TC versus Everything

Post by *ghisler(Author) »

I'm adding double quotes now in RC2 around regular expressions, please test whether it works for you or not.
Author of Total Commander
https://www.ghisler.com
User avatar
tuska
Power Member
Power Member
Posts: 3740
Joined: 2007-05-21, 12:17 UTC

Re: Regex syntax in TC versus Everything

Post by *tuska »

I only tested these examples and the first example works now in TC 9.21rc2 as well:

Code: Select all

^(ABC|BCD) .............. 'Everything' ticked, 'RegEx' ticked 
ed:regex:"^(ABC|BCD)" ... 'Everything' ticked, 'RegEx' NOT ticked!
Thanks!
Post Reply