Lister: Search for "\t" always operates in RegEx-M

English support forum

Moderators: Hacker, petermad, Stefan2, white

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

Post by *wanderer »

Hmmm. Thanks. So, i guess that in order to search for the string "\\" (2 backslashes), one would actually have to enter \\\\ (4 backslashes). Funny though, 3 backslashes also finds \\ in a file! Anyway...
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
redfox
Member
Member
Posts: 101
Joined: 2015-02-09, 11:36 UTC
Location: Czech Republic

Find text containing backslash in a file content = 0 results

Post by *redfox »

Steps to reproduce:

1) Create a txt (bat etc.) file in a directory. The text will contain "\", for example \test.
2) Press Alt+F7, fill a search phrase "\test" in the "find text" field and start the search; all the search options are default (Ansi win/dos, utf 8/16 ON).
3) No results will be found.

Additional testing:

Change the file content to

a) \test no results
b) test\ ok
c) te\st ok
d) c\test no result
e) c:\test no result
f) ccc\test no result

Please, fix the bug ASAP, it is very serious for me.
Thanks
Last edited by redfox on 2017-05-14, 13:41 UTC, edited 1 time in total.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Next time let out the ASAP
and take the time to read more from the help !
The \t has to be escaped as it stands for a tab.
So you have to search for \\test
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9945
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

TC help wrote:Find text
If this option is checked, you can enter text to be searched. With \t you find tabstops, and with \n line breaks (ENTER) in texts. To find a backslash \, you need to give it twice: \\ .
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
redfox
Member
Member
Posts: 101
Joined: 2015-02-09, 11:36 UTC
Location: Czech Republic

Post by *redfox »

There should be an option at least in the wincmd.ini to enable text searching in a standard way, without automatically resolving backslash as a part of a possible escape sequence.
This one, i.e. the need of typing it twice, is really uncomfortable. Most people want to search for a phrase containing one or more backslash characters - especially in a source code / file paths. On the other side, finding a tab (\t) or a newline (\n) sequence in a file is a rare case, I personally never needed it.

Sorry for the "ASAP".
Last edited by redfox on 2017-05-14, 13:47 UTC, edited 3 times in total.
User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Moderator message

Moved to the English forum.

Hacker (Moderator)
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I also think that escaping should be optional, as it is in text editors, because normal text is searched much more often than escaped text...
Garrett
Junior Member
Junior Member
Posts: 13
Joined: 2006-11-06, 07:45 UTC

Search text (as text) '\\' treat as '\' (as regexp)

Post by *Garrett »

TC 10.52

1. Create text file with string "033\\^\033".
2. try find text "033\\^\033" in viewer or by Alt-F7 in current dir (both without regexp) - no result.

TC treat \\ as \ and search "033\\^\033" as "033\^\033"...
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Search text (as text) '\\' treat as '\' (as regexp)

Post by *AntonyD »

2Garrett
so use this:
033\\\^\\033

Or you want to understand - why in principle TC treat \\ as \? even if we do not tick checkmark for RegExp?
#146217 personal license
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Search text (as text) '\\' treat as '\' (as regexp)

Post by *petermad »

2Garrett

This is not a bug, it is a feature:
Help wrote:Find text If this option is checked, you can enter text to be searched. With \t you find tabstops, and with \n line breaks (ENTER) in texts. To find a backslash \, you need to give it twice: \\ .
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Garrett
Junior Member
Junior Member
Posts: 13
Joined: 2006-11-06, 07:45 UTC

Re: Search text (as text) '\\' treat as '\' (as regexp)

Post by *Garrett »

petermad wrote: 2023-03-31, 11:11 UTC 2Garrett

This is not a bug, it is a feature:
Help wrote:Find text If this option is checked, you can enter text to be searched. With \t you find tabstops, and with \n line breaks (ENTER) in texts. To find a backslash \, you need to give it twice: \\ .
Maybe it's better to make the special codes work only if there is a check mark on the regular expressions checkbox?
browny
Senior Member
Senior Member
Posts: 359
Joined: 2007-09-10, 13:19 UTC

Search for \t in Lister

Post by *browny »

Windows 11 current, TC 11.50b5, 64-bit (same behaviour in 11.03 with deleted [Lister] section)
Create a file with a string containing \t, for example

Code: Select all

whatever\tmore
Search for \t fails.
All checkboxes unticked, so this is not a regular expression or wrong case.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Search for \t in Lister

Post by *Horst.Epp »

\t searches for a tab, regardless of the regex setting.
Try \\t
And next time, please don't make error reports before checking the help and the forum.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Search for \t in Lister

Post by *ghisler(Author) »

2Horst.Epp
It's OK, better too many reports than no reports.
Author of Total Commander
https://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Search for \t in Lister

Post by *Horst.Epp »

ghisler(Author) wrote: 2024-11-12, 08:31 UTC 2Horst.Epp
It's OK, better too many reports than no reports.
Agreed, but why not asking first in the normal English forum.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Post Reply