Where can I find reference for less
regex search patterns?
I want to search file with less
using \d
to find digits, but it does not seem to understand this wildcard. I tried to find a reference for less
regex patterns, but could not find anything, not on man pages and not on the Internet.
as recognized by the regular expression library supplied by your system. < so… any way to direct
– JamesTheAwesomeDude Jan 28 '21 at 20:54less
tolibpcre
?/a|e/
, less only highlights the a's. If I enter the command/a\|e/
I get pattern not found. This tends to support that less is accepting the basic syntax, according toman re_format
. If I made a mistake in trying to invoke extended syntax, please let me know. – cardiff space man Jun 09 '22 at 22:51/
there? I don't thinkless
expects that, so it'll look for the stringe/
as the other alternative. It has to be extended regexes, since BRE doesn't have the alternation, and in BRE,a|e
would look for that literal string – ilkkachu Jun 09 '22 at 23:02/
does make the command work as expected, extended RE. – cardiff space man Jun 15 '22 at 01:09