RegEx searching for RETURN

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

RegEx searching for RETURN

Post by *StatusQuo »

Hi!

The exercise:
I was trying to find files containing "[" at the line beginning of some ASCII files,
so I searched for files containing the RegEx "\n\[" - without success. The same RegEx works OK in my text editor.

The workarounds/alternatives:
- search for RegEx "^\[" (works)
- search for hexadecimal representation of the values ("0d 0a 5b"). (works)

Suggestion:
  • The RegEx-search in the find files function doesn't seem to find CR/LF with "\n" -
    maybe this can be added, if it's not hard to implement?
  • This is not mentioned in the help (a hint would be nice there, if this will not be added).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Just search for "\n\[" WITHOUT checking the regEx option.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

petermad wrote:Just search for "\n\[" WITHOUT checking the regEx option.
Almost: "\n[" (without the second backslash) does the job without RegEx.
Thanks for the hint.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2StatusQuo
without the second backslash
That was what I meant to write - sorry.


BTW - it also works for tabs: \t[
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I searched for files containing the RegEx "\n\[" - without success.
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 $.
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

However, the beginning and end of a line can be found via ^ and $.
This works fine, thanks.
Maybe this sentence can be added to the help, perhaps on a central position like the RegEx parameter description page
("Note: You can not use \n together in TC's RegEx search, but...").
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

StatusQuo wrote:Maybe this sentence can be added to the help
It's already mentioned:
The other modificators are not relevant for Total Commander, because the program only supports searching within one line.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Flint wrote:It's already mentioned:
The other modificators are not relevant for Total Commander, because the program only supports searching within one line.
OK, I missed that line, thanks. But the hint with the alternative is not there yet.
But this is maybe not a problem anymore, too, since now one can find the answer here with corresponding search keywords... :)


(for future searches: newline, line break)
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

StatusQuo wrote:But the hint with the alternative is not there yet.
I'm not sure it is necessary. The ^ and $ metacharacters are well-described; it's an easy task to make appropriate conclusion. IMHO, of course.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
Post Reply