Regex syntax in TC versus Everything

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

Moderators: sheep, Hacker, Stefan2, white

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

Regex syntax in TC versus Everything

Post by *nsp » 2018-07-27, 09:22 UTC

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 viewtopic.php?f=16&t=50475

User avatar
tuska
Power Member
Power Member
Posts: 1586
Joined: 2007-05-21, 12:17 UTC

Re: Regex syntax in TC versus Everything

Post by *tuska » 2018-07-27, 10:47 UTC

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: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Regex syntax in TC versus Everything

Post by *ghisler(Author) » 2018-07-29, 07:21 UTC

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
http://www.ghisler.com

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Regex syntax in TC versus Everything

Post by *ghisler(Author) » 2018-08-01, 16:37 UTC

I'm adding double quotes now in RC2 around regular expressions, please test whether it works for you or not.
Author of Total Commander
http://www.ghisler.com

User avatar
tuska
Power Member
Power Member
Posts: 1586
Joined: 2007-05-21, 12:17 UTC

Re: Regex syntax in TC versus Everything

Post by *tuska » 2018-08-01, 19:12 UTC

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