Fossil

Regular Expression Syntax
Login

Syntax rules for regular expression matching in Fossil:

   Pattern    Match
X* Zero or more occurrences of X
X+ One or more occurrences of X
X? Zero or one occurrences of X
X{P,Q} Between P and Q occurrences of X
(X) X
X|Y X or Y
^X X at the beginning of the string
X$ X at the end of the string
. Any single character
\C Character C if C is one of: \{}()[]|*+?
\C C-language escapes if C is one of: afnrtv
\uHHHH Unicode character U+HHHH where HHHH is four hex digits
\HH Unicode character U+00HH where HH is two hex digits
[abc] Any single character from abc
[^abc] Any single character not in abc
[a-z] Any single character between a and z, inclusive
[^a-z] Any single character not between a and z
\b Word boundary
\w A word character: a-zA-Z0-9 or _
\W A non-word character
\d A digit. 0-9
\D A non-digit character
\s A whitespace character
\S A non-whitespace character

In the "Pattern" column of the table above:

The "X|Y" pattern has lower precedence than the others. Use "(...)" for grouping, as necessary.