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

English support forum

Moderators: Hacker, petermad, Stefan2, white

sem
Junior Member
Junior Member
Posts: 2
Joined: 2007-06-27, 20:24 UTC

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

Post by *sem »

In Lister, a search for the string "\t" in normal mode (e.g. "Reg. Expr." not checked) matches tabs (as it would in RegEx-Mode), not the real string "\t". (XP-SP2, TC 7.01)

Besides that (has to be said, because it's my first posting here): Many thanks for this very, very, very great tool!!
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Enter "\\t" as your search string. This will search for the string "\t" literally and find it.
The same is true e.g. for the string "\n". Enter "\\n" as your search string.
In order to search for a "\", you enter "\\" as your search string.

Doubling the "\" will mask its special meaning: \t means tab character, \n means newline, \\ denotes the backslash character itself.

Karl
Last edited by karlchen on 2007-06-27, 21:21 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

From the Help file:
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: \\ .
This is because TC supported finding tabstobs and line breaks way before support for RegEx was introduced.
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
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.
sem
Junior Member
Junior Member
Posts: 2
Joined: 2007-06-27, 20:24 UTC

Post by *sem »

Thanks for your replies and sorry: It's explained very clear in the help file indeed.
I had the fixed idea that it has to be a bug, because there is the (great) alternative of using RegEx for matching special characters and I just wanted to find my "\t"s among other paths ;-)
Finally, in literal search mode it's a bit confusing that backslashes have to be (and may be) quoted only, when combined with "t" or "n".
User avatar
Tahattmeruh
Senior Member
Senior Member
Posts: 244
Joined: 2003-05-16, 13:35 UTC

Bug in Lister with search

Post by *Tahattmeruh »

I open a textfile and search for the string "\n" without the quotes.
But what I get is that every line ending is found. That's not what
I wanted. I have no RegEx search selected.
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

Issue confirmed BUT...

Try to search:
\\n

I think it goes for other special strings too (\t, ...).
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
User avatar
Tahattmeruh
Senior Member
Senior Member
Posts: 244
Joined: 2003-05-16, 13:35 UTC

Post by *Tahattmeruh »

\\n is working.
But I think most user won't know this and won't remember this.
I think the search should search for the string and only search
for \n as new line in regex mode.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

2Tahattmeruh: You may read the help (press "Help" button at search dialog) to read the details.

Note: \n as new line is not valid in regex mode !
#5767 Personal license
User avatar
Tahattmeruh
Senior Member
Senior Member
Posts: 244
Joined: 2003-05-16, 13:35 UTC

Post by *Tahattmeruh »

sqa_wizard wrote:Note: \n as new line is not valid in regex mode !
You are right. At least in TotalCommander.
I'm used to use MS .Net RegEx
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.
d
Member
Member
Posts: 157
Joined: 2007-02-05, 14:54 UTC

Post by *d »

"But I think most user won't know this and won't remember this.
I think the search should search for the string and only search
for \n as new line in .."
i agree.

"Note: \n as new line is not valid in regex mode !"
what to use instead of \n in regex mode?
..
i have seen the help, so \x0a?
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

d wrote:what to use instead of \n in regex mode?
RegEx searching for RETURN
ghisler(Author) wrote:Sorry, this cannot work, because RegEx in Total Commander is limited to single lines - it cannot find multiple lines. Therefore a regex search string will never contain any line breaks. However, the beginning and end of a line can be found via ^ and $.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Lister search question with \\

Post by *wanderer »

Open a text file in lister, press CTRL+F and without having any checkboxes checked, enter \\ in the search text. Lister will select the first \ character (not \\) it meets in the file. Is this a normal behavior? Shouldn't RegEx be checked for it to work like this?
- 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
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Lister search question with \\

Post by *Horst.Epp »

wanderer wrote:Open a text file in lister, press CTRL+F and without having any checkboxes checked, enter \\ in the search text. Lister will select the first \ character (not \\) it meets in the file. Is this a normal behavior? Shouldn't RegEx be checked for it to work like this?
Yes, its normal and documented in the help.
Its needed to support \n and \t in normal searches.
Post Reply