大家讲道理2017-04-17 15:57:00
-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.
This parameter will affect the matching behavior of -regex [pattern], similar to using different dialects to parse regular expressions.
After my experiment, I feel like writing this
find . -regextype posix-extended -regex './autojump.(bash|zsh|sh)'
或者
find . -regextype posix-extended -regex './autojump.(ba|z)?sh'
The regular matching of ./auto...
的./
是不能省略的,find
cannot only match part of it, but must match completely (understand).
==update==
If the previous path is very long, you can match it like this
find . -regextype posix-extended -regex '.*autojump.(ba|z)?sh'