Characters |
|
. |
Any character |
\n |
Newline |
\t |
Tab |
\xhh |
Hex character |
\x{hhhh} |
Hex character |
Character sets |
|
\w |
Word character |
\W |
Non-word character |
\s |
Whitespace character |
\S |
Non-whitespace character |
\d |
Digit character |
\D |
Non-digit character |
[xyz] |
Any character in the set |
[^xyz] |
Any character not in the set |
Quantifiers |
|
* |
Zero or more |
+ |
One or more |
? |
Optional |
{m,n} |
At least m and at most n times |
{m,} |
At least m times |
{n} |
Exactly n times |
Anchoring characters |
|
^ |
Beginning of line |
$ |
End of line |
Characters |
|
\n |
Newline |
\t |
Tab |
\xhh |
Hex character |
\x{hhhh} |
Hex character |
Numbered Backreferences |
|
\1 |
1st backreference |
\2 |
2nd backreference |
\3 |
3rd backreference |
$1 |
1st backreference |
$2 |
2nd backreference |
$3 |
3rd backreference |