Page 1 of 1

Lister: Text with backslash not found sometimes

Posted: 2022-11-26, 14:25 UTC
by WolfgangK
If you search for a text with a backslash inside, it is sometimes not found in Lister.

This happens if the character after the backslash results in a valid code, e.g. "text\something" works quite well, but "text\this" does not. That is because instead of searching for the literal text, the \t is replaced with a tab character and the search tries to find "text<tab>his" instead. (Same thing for \n,)

I couldn't find a documentation about this. I thought the codes might be the same as in C++ or Java, but it seems \r is not a valid code. I am also not sure if \n searches only for <CR><LF> (Windows default) or any combination of <CR> and <LF> or only for some of them.

The way it is now, can easily lead to mistakes. If you copy a text containing a backslash and then paste it into the search dialog, Lister may say that it doesn't exist even though it does. Unless you remember that there might be an issue with backslashes and double all of them. That is especially bothersome when you are searching for various filepaths in several logfiles.

While it is a very good idea to be able to search for special characters, I think, it should be an option you turn on explicitly like RegEx, because most of the time you are not searching for tabs or line breaks. Coloring valid codes in the search dialog might be another possibility, at least then you see immediately that there is something special in the text.

BR, WolfgangK

Re: Lister: Text with backslash not found sometimes

Posted: 2022-11-26, 14:52 UTC
by Hacker
WolfgangK,
I couldn't find a documentation about this.
F3 - F7 - F1.

HTH
Roman

Re: Lister: Text with backslash not found sometimes

Posted: 2022-11-26, 14:52 UTC
by Hacker

Moderator message from: Hacker

Moved to the English forum.

Re: Lister: Text with backslash not found sometimes

Posted: 2022-11-26, 15:49 UTC
by Horst.Epp
Hacker wrote: 2022-11-26, 14:52 UTC WolfgangK,
I couldn't find a documentation about this.
F3 - F7 - F1.

HTH
Roman
That doesn't help much for this problem :(

In my Editors (AkelPad, PSPad, Syn2) you can enable RegEx to search for tabs with \t
and disable RegEx to search for literal \t

In native lister there is no difference with enable or disable RegEx.
It always finds tabs when searching for \t

So the only way is to double the backslash.
Unfortunately my preferred text Lister plugin (CudaLister) has the same problem.

Re: Lister: Text with backslash not found sometimes

Posted: 2022-11-26, 16:17 UTC
by Hacker
Horst.Epp,
Perhaps you misunderstood what I was quoting and replying to.

Roman

Re: Lister: Text with backslash not found sometimes

Posted: 2024-05-14, 08:19 UTC
by Poke45
just a bump on this issue i.e. if there is any chance a future version of TOTAL COMMANDER could include the feature to give the user control over settings which potentially sabotage text searches on the backslash character. i have been using TOTAL COMMANDER's text search feature for years and only recently realised in some cases text searches were retrieving invalid results (e.g. try searching for "\\tsclient" in a source file which contains that exact text: no results will be found)

i also use an excellent program called NOTEPAD 2 and that program's text search options include a checkbox against whether or not you wish to "Transform backslashes"; something like that seems appropriate here?

i am updating this discussion board as on brief glance it seems to be the most recent, but the same topic is discussed in other threads as well
e.g.
viewtopic.php?t=47864
viewtopic.php?t=27146

Re: Lister: Text with backslash not found sometimes

Posted: 2024-05-14, 09:22 UTC
by ghisler(Author)
\t is interpreted as a tab character and \n as a new line when searching.

Re: Lister: Text with backslash not found sometimes

Posted: 2024-05-14, 10:43 UTC
by white
ghisler(Author) wrote: 2024-05-14, 09:22 UTC \t is interpreted as a tab character and \n as a new line when searching.
And \\ as a backslash character. This was already clear. The suggestion is to make this interpretation optional.

Moderator message from: white » 2024-05-14, 10:42 UTC

Moved topic
» from Total Commander (English) to TC suggestions (English)