Regular Expressions

Each character matches itself, unless it is one of the special characters + ? . * ^ $ ( ) [ ] { } | \. The special meaning of these characters can be escaped using a \.

Quantified subpatterns match as many times as possible. When followed with a ? they match the minimum number of times. These are the quantifiers:

A \ escapes any special meaning of the following character if non-alphanumeric, but it turns most alphanumeric characters into something special:

Back-references:

See also $1...$9, $+, $&, $`, and $' in the section called "Special Variables".

With modifier x, whitespace can be used in the patterns for readability purposes.