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.
Best Answer
less
's man page says:so the accepted syntax may depend on your system. Off-hand, it seems to accept extended regular expressions on my Debian system, see
regex(7)
, and Why does my regular expression work in X but not in Y?\d
is from Perl, and isn't supported by all regex engines. Use[0-9]
or[[:digit:]]
to match digits. (Their exact behaviour may depend on the locale.)