I'm reading the GNU find
's man page and stumbling upon this switch:
-regextype type
Changes the regular expression syntax understood by -regex and
-iregex tests which occur later on the command line. Currently-
implemented types are emacs (this is the default), posix-awk, posix-
basic, posix-egrep and posix-extended.
What's the difference between those regex syntaxes? I'm more familiar with Ruby's regex, so what type of regex should I use with find
?
Regular expressions are implemented in many ways. POSIX Extended Expressions know the same metacharacters as POSIX Basic Expressions but with a few additions as you can see on this page.
In some cases one might want to use a certain metacharacter known by one of those implementations and you can use this option to tell find
which one you are using.
If you only need a more basic expression, posix-basic would be enough.
Also you might just prefer the type of RegEx you are used to and find
is able to interpret it correctly.
As fge mentioned, use this site to learn more about the differences between RegEx syntactics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With