Lam*_*mnk 12 regex syntax posix find
我正在阅读GNU find的手册页并绊倒这个开关:
-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.
Run Code Online (Sandbox Code Playgroud)
这些正则表达式语法之间有什么区别?我对Ruby的正则表达式更熟悉,那么我应该使用什么类型的正则表达式find?
正则表达式以多种方式实现.POSIX扩展表达式知道与POSIX Basic Expressions相同的元字符,但在本页面上可以看到一些附加元素.
在某些情况下,人们可能希望使用其中一个实现所知的某个元字符,您可以使用此选项来告诉find您正在使用哪个元字符.如果你只需要一个更基本的表达式,posix-basic就足够了.
您也可能更喜欢您习惯的RegEx类型,并且find能够正确解释它.
如上所述,使用此站点可以了解有关RegEx语法之间差异的更多信息.