68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
-
+
-
-
-
-
-
+
+
+
+
+
|
| `X?` | zero or one occurrences of X
| `X{p,q}`| between p and q occurrences of X, inclusive
| `(X)` | match X
| <tt>X\|Y</tt>| X or Y
| `^X` | X occurring at the beginning of a line
| `X$` | X occurring at the end of a line
| `.` | Match any single character
| `\c` | Character `c` where `c` is one of <tt>{}()[]\|\*+?.</tt>
| `\c` | Character `c` where `c` is one of <tt>{}()[]\|\*+?.\\</tt>
| `\c` | C-language escapes for `c` in `afnrtv`. ex: `\t` or `\n`
| `\uXXXX`| Where XXXX is exactly 4 hex digits, Unicode value XXXX
| `\xXX` | Where XX is exactly 2 hex digits, Unicode value XX
| `[abc]` | Any single character from the set `abc`
| `[^abc]`| Any single character not in the set `abc`
| `[a-z]` | Any single character in the range `a-z`
| `[^a-z]`| Any single character not in the range `a-z`
| `\b` | Word boundary
| `\w` | Word character: `[A-Za-z0-9_]`
| `\W` | Non-word character
| `\d` | Digit
| `\D` | Non-digit
| `\s` | Whitespace character
| `\S` | Non-whitespace character
| `\W` | Non-word character: `[^A-Za-z0-9_]`
| `\d` | Digit: `[0-9]`
| `\D` | Non-digit: `[^0-9]`
| `\s` | Whitespace character: `[ \t\r\n\v\f]`
| `\S` | Non-whitespace character: `[^ \t\r\n\v\f]`
There are several restrictions in Fossil `grep` relative to a fully
POSIX compatible regular expression engine. Among them are:
* There is currently no support for POSIX character classes such as
`[:lower:]`.
|