find: posix-extended regular expression syntax
1
1 8.5.10 'posix-extended' regular expression syntax
1 -------------------------------------------------
1
1 The character '.' matches any single character except the null
1 character.
1
1 '+'
1 indicates that the regular expression should match one or more
1 occurrences of the previous atom or regexp.
1 '?'
1 indicates that the regular expression should match zero or one
1 occurrence of the previous atom or regexp.
1 '\+'
1 matches a '+'
1 '\?'
1 matches a '?'.
1
1 Bracket expressions are used to match ranges of characters. Bracket
1 expressions where the range is backward, for example '[z-a]', are
1 invalid. Within square brackets, '\' is taken literally. Character
1 classes are supported; for example '[[:digit:]]' will match a single
1 decimal digit.
1
1 GNU extensions are supported:
1
1 1. '\w' matches a character within a word
1
1 2. '\W' matches a character which is not within a word
1
1 3. '\<' matches the beginning of a word
1
1 4. '\>' matches the end of a word
1
1 5. '\b' matches a word boundary
1
1 6. '\B' matches characters which are not a word boundary
1
1 7. '\`' matches the beginning of the whole input
1
1 8. '\'' matches the end of the whole input
1
1 Grouping is performed with parentheses '()'. An unmatched ')'
1 matches just itself. A backslash followed by a digit acts as a
1 back-reference and matches the same thing as the previous grouped
1 expression indicated by that number. For example '\2' matches the
1 second group expression. The order of group expressions is determined
1 by the position of their opening parenthesis '('.
1
1 The alternation operator is '|'.
1
1 The characters '^' and '$' always represent the beginning and end of
1 a string respectively, except within square brackets. Within brackets,
1 '^' can be used to invert the membership of the character class being
1 specified.
1
1 '*', '+' and '?' are special at any point in a regular expression
1 except the following places, where they are not allowed:
1
1 1. At the beginning of a regular expression
1
1 2. After an open-group, signified by '('
1 3. After the alternation operator '|'
1
1 Intervals are specified by '{' and '}'. Invalid intervals such as
1 'a{1z' are not accepted.
1
1 The longest possible match is returned; this applies to the regular
1 expression as a whole and (subject to this constraint) to subexpressions
1 within groups.
1