Lister: Search for "\t" always operates in RegEx-M
Moderators: Hacker, petermad, Stefan2, white
Lister: Search for "\t" always operates in RegEx-M
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!!
Besides that (has to be said, because it's my first posting here): Many thanks for this very, very, very great tool!!
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
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.
From the Help file:
This is because TC supported finding tabstobs and line breaks way before support for RegEx was introduced.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
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
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".
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".
- Tahattmeruh
- Senior Member
- Posts: 244
- Joined: 2003-05-16, 13:35 UTC
Bug in Lister with search
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.
But what I get is that every line ending is found. That's not what
I wanted. I have no RegEx search selected.
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
- Tahattmeruh
- Senior Member
- Posts: 244
- Joined: 2003-05-16, 13:35 UTC
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- Tahattmeruh
- Senior Member
- Posts: 244
- Joined: 2003-05-16, 13:35 UTC
RegEx searching for RETURNd wrote:what to use instead of \n in regex mode?
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!
-- TC starter menu: Fast yet descriptive command access!
Lister search question with \\
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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
Re: Lister search question with \\
Yes, its normal and documented in the help.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?
Its needed to support \n and \t in normal searches.