What types of regex DO support (e.g.) negative lookbehind?
Bash on GNU:
I am using a collection of
find commands, most of which employ
-regex to do their matching. Each time I try a different feature in my regex I have to cycle through the values for
-regextype until one works. My particular need in this case is for one that supports negative lookbehind. It’s hard to validate the (zero) results of my tests on this feature so I would like to simply refer to a list rather than repeating increasing series of tests.
It would be nice to see a chart somewhere listing many of the popular regex styles and the features they do and do not support, but I couldn’t find that either.
If you want a
-regex supports look-around operators à la
perl, you can use ast-open’s
$ find /etc -regex '.*(?<!g)shadow'
-regextype is specific to the GNU implementation of
find and none of the regex types it supports have look-around operators AFAIK.