ZTree.com  | ZEN  | About...  

 Index   Back

[Q] Search at start of line   [Q]

By: Nick Williams     West Sussex, England (forum time +5 hrs)  
Date: Apr 26,2018 at 20:45
In Response to: [Q] Search at start of line (David Bullock)

> Greetings everyone!
> Does anyone know of a way to search all tagged files for instances of
> "LLX" (fer instance) at the start of a line; i.e., in positions 1-3 ?
> The version of Linux used at our office here uses a carat character (^)
> to accomplish this, but I do not know if Windows or ZTree has a similar
> ability.

Hi David,

ZTreeWin does not (currently) support the use of the '^' and '$' that represent 'start-of-line' and 'end-of-line' anchors, respectively, in regular expression searches.

Taking your example, 'LLX'-at-the-start-of-a-line, the closest I can think of, is to search -- in Hex mode -- for the CRLF pair of the previous line plus the characters, 'LLX'.

So, your search criteria, in Hex mode, would be: 0D 0A 4C 4C 58

Actually, thinking about it, it would be better to search for just: 0A 4C 4C 58

That way, it will work for both DOS/Windows file-endings (i.e. CRLF = '\r\n' = 0D 0A) or UNIX/Linux file-endings: (i.e. LF = '\n' = 0A).

A clumsy workaround, admittedly, and be aware that if 'LLX' occurred at the beginning of the very first line of the file, it would not be counted (because there's no preceding end-of-line).

Not great, but it might help you.

N.B. I just tried this before posting, and although it works as expected, I noticed that ZTreeWin highlights the wrong area -- I think that's a little bug.

Kind regards

Thread locked

Messages in this Thread

95,077 Postings in 11,987 Threads, 350 registered users, 130 users online (0 registered, 130 guests)
Index | Admin contact |   Forum Time: Aug 14, 2020 - 3:16 pm EDT  |  Hits:33,118,041  (17,803 Today )
RSS Feed