Next: , Previous: , Up: Reference   [Contents][Index]


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 almost identical to that used in GNU Emacs. The single difference is that in find and locate, a ‘.’ will match a newline character.

Both find and locate provide an option which allows selecting 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:


Next: , Previous: , Up: Reference   [Contents][Index]