If e and f are regular‑expressions , so is e | f , a re-choice expression, that matches e or f .
If e and f are regular‑expressions , so is e f , a catenation expression, that matches e followed by f .
If e is a regular‑expression , so are e * , e + and e ? . Expression e * matches 0...N occurrences of e , e + matches 1...N occurrences of e , and e ? matches 0...1 occurrences of e .
If e is a regular‑expression , so is ( e ) , a grouping expression.
The following escape sequences start with a backslash character.
\x or \X followed by a hexadecimal digit sequence c matches a Unicode character whose code point is equal to c .
\d or \D followed by a decimal digit sequence c matches a Unicode character whose code point is equal to c .
\ followed by an octal digit sequence c matches a Unicode character whose code point is equal to c .
\u followed by four hexadecimal digits c matches a Unicode character whose code point is equal to c .
\U followed by eight hexadecimal digits c matches a Unicode character whose code point is equal to c .
| Escape | Value |
|---|---|
| \a | \u0007 |
| \b | \u0008 |
| \f | \u000c |
| \n | \u000a |
| \r | \u000d |
| \t | \u0009 |
| \v | \u000b |
Any other character following the backslash character matches that character literally.
Single characters or character ranges like a-z inside square brackets form a character class .
A character class matches any single input character from the set of character contained by the class.
If the first character that follows the left square bracket is a caret ( ^ ), the class matches all but the listed characters and ranges following the caret.
The . character matches any single character except newline.
A regular expression in an expression‑file may refer to preceding expressions by name by enclosing the expression‑name inside braces. This forms an expression‑reference .
Similarly a regular expression in a lexer‑file may refer to expressions contained by imported expression files by name by enclosing the expression‑name inside braces.
Any other character matches current input character literally.