Next: , Previous: Invoking xargs, Up: Reference


8.5 Regular Expressions

The ‘-regex’ and ‘-iregex’ tests of find allow matching by regular expression, as does the ‘--regex’ option of locate.

Your locale configuration affects how regular expressions are interpreted. See Environment Variables, for a description of how your locale setup affects the interpretation of regular expressions.

There are also several different types of regular expression, and these are interpreted differently. Normally, the type of regular expression used by find and locate is the same as is used in GNU Emacs. Both programs provide an option which allows you to select an alternative regular expression syntax; for find this is the ‘-regextype’ option, and for locate this is the ‘--regextype’ option.

These options take a single argument, which indicates the specific regular expression syntax and behaviour that should be used. This should be one of the following: