findutils-default regular expression syntax
-------------------------------------------

The character . matches any single character.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are ignored.  Within square brackets, \ is taken literally.  Character classes are not supported, so for example you would need to use [0-9] instead of [[:digit:]].

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with backslashes followed by parentheses \(, \).  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis \(.

The alternation operator is \|.

The character ^ only represents the beginning of a string when it appears:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

The character $ only represents the end of a string when it appears:

 1. At the end of a regular expression

 2. Before an close-group, signified by \)

 3. Before the alternation operator \|

*, + and ? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

awk regular expression syntax
-----------------------------

The character . matches any single character except the null character.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are invalid.  Within square brackets, \ can be used to quote the following character.  Character classes are not supported, so for example you would need to use [0-9] instead of [[:digit:]].

GNU extensions are not supported and so \w, \W, \<, \>, \b, \B, \`, and \' match w, W, <, >, b, B, `, and ' respectively.

Grouping is performed with parentheses ().  An unmatched ) matches just itself.  A backslash followed by a digit matches that digit.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

*, + and ? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by (

 3. After the alternation operator |

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

egrep regular expression syntax
-------------------------------

The character . matches any single character except newline.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are ignored.  Within square brackets, \ is taken literally.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.  Non-matching lists [^...] do not ever match newline.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with parentheses ().  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis (.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

The characters *, + and ? are special anywhere in a regular expression.

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

emacs regular expression syntax
-------------------------------

The character . matches any single character except newline.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are ignored.  Within square brackets, \ is taken literally.  Character classes are not supported, so for example you would need to use [0-9] instead of [[:digit:]].

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with backslashes followed by parentheses \(, \).  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis \(.

The alternation operator is \|.

The character ^ only represents the beginning of a string when it appears:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

The character $ only represents the end of a string when it appears:

 1. At the end of a regular expression

 2. Before an close-group, signified by \)

 3. Before the alternation operator \|

*, + and ? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

gnu-awk regular expression syntax
---------------------------------

The character . matches any single character.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are invalid.  Within square brackets, \ can be used to quote the following character.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with parentheses ().  An unmatched ) matches just itself.  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis (.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

*, + and ? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by (

 3. After the alternation operator |

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

grep regular expression syntax
------------------------------

The character . matches any single character except newline.

\+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

\?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

+ and ?
     match themselves.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are ignored.  Within square brackets, \ is taken literally.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.  Non-matching lists [^...] do not ever match newline.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with backslashes followed by parentheses \(, \).  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis \(.

The alternation operator is \|.

The character ^ only represents the beginning of a string when it appears:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After a newline

 4. After the alternation operator \|

The character $ only represents the end of a string when it appears:

 1. At the end of a regular expression

 2. Before an close-group, signified by \)

 3. Before a newline

 4. Before the alternation operator \|

\*, \+ and \? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After a newline

 4. After the alternation operator \|

Intervals are specified by \{ and \}.  Invalid intervals such as a\{1z are not accepted.

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

posix-awk regular expression syntax
-----------------------------------

The character . matches any single character except the null character.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are invalid.  Within square brackets, \ can be used to quote the following character.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.

GNU extensions are not supported and so \w, \W, \<, \>, \b, \B, \`, and \' match w, W, <, >, b, B, `, and ' respectively.

Grouping is performed with parentheses ().  An unmatched ) matches just itself.  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis (.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

*, + and ? are special at any point in a regular expression except the following places, where they are not allowed:

 1. At the beginning of a regular expression

 2. After an open-group, signified by (

 3. After the alternation operator |

Intervals are specified by { and }.  Invalid intervals such as a{1z are not accepted.

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

posix-basic regular expression syntax
-------------------------------------

The character . matches any single character except the null character.

\+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

\?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

+ and ?
     match themselves.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are invalid.  Within square brackets, \ is taken literally.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with backslashes followed by parentheses \(, \).  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis \(.

The alternation operator is \|.

The character ^ only represents the beginning of a string when it appears:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

The character $ only represents the end of a string when it appears:

 1. At the end of a regular expression

 2. Before an close-group, signified by \)

 3. Before the alternation operator \|

\*, \+ and \? are special at any point in a regular expression except:

 1. At the beginning of a regular expression

 2. After an open-group, signified by \(

 3. After the alternation operator \|

Intervals are specified by \{ and \}.  Invalid intervals such as a\{1z are not accepted.

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

posix-egrep regular expression syntax
-------------------------------------

The character . matches any single character except newline.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are ignored.  Within square brackets, \ is taken literally.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.  Non-matching lists [^...] do not ever match newline.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with parentheses ().  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis (.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

The characters *, + and ? are special anywhere in a regular expression.

Intervals are specified by { and }.  Invalid intervals are treated as literals, for example a{1 is treated as a\{1

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.

posix-extended regular expression syntax
----------------------------------------

The character . matches any single character except the null character.

+
     indicates that the regular expression should match one or more occurrences of the previous atom or regexp.

?
     indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.

\+
     matches a +

\?
     matches a ?.

Bracket expressions are used to match ranges of characters.  Bracket expressions where the range is backward, for example [z-a], are invalid.  Within square brackets, \ is taken literally.  Character classes are supported; for example [[:digit:]] will match a single decimal digit.

GNU extensions are supported:

 1. \w matches a character within a word

 2. \W matches a character which is not within a word

 3. \< matches the beginning of a word

 4. \> matches the end of a word

 5. \b matches a word boundary

 6. \B matches characters which are not a word boundary

 7. \` matches the beginning of the whole input

 8. \' matches the end of the whole input

Grouping is performed with parentheses ().  An unmatched ) matches just itself.  A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number.  For example \2 matches the second group expression.  The order of group expressions is determined by the position of their opening parenthesis (.

The alternation operator is |.

The characters ^ and $ always represent the beginning and end of a string respectively, except within square brackets.  Within brackets, ^ can be used to invert the membership of the character class being specified.

*, + and ? are special at any point in a regular expression except the following places, where they are not allowed:

 1. At the beginning of a regular expression

 2. After an open-group, signified by (

 3. After the alternation operator |

Intervals are specified by { and }.  Invalid intervals such as a{1z are not accepted.

The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.