Cheatography
https://cheatography.com
A quick reference guide for notepad++ regular expressions (regex), including symbols, ranges, grouping, assertions and some sample patterns to get you started.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Anchors
^ |
Start of string, or start of line in multi- line pattern |
$ |
End of string, or end of line in multi-line pattern |
\< |
Start of word |
\> |
End of word |
Special Characters
\n |
New line |
\r |
Carriage return |
\t |
Tab |
Quantifiers
* |
Zero or more times. |
+ |
One or more. |
{\d } |
Exactly. |
{\d,\d} |
In between. |
? |
Once or none. |
|
|
Characters
\s |
White space |
\S |
Not white space |
\d |
Digit |
\D |
Not digit |
\w |
Word |
\W |
Not word |
Groups and Ranges
. |
Any character except new line (\n) |
(a|b) |
a or b |
(...) |
Group |
(?:...) |
Passive (non-capturing) group |
[abc] |
Range (a or b or c) |
[^abc] |
Not (a or b or c) |
[a-q] |
Lower case letter from a to q |
[A-Q] |
Upper case letter from A to Q |
[0-7] |
Digit from 0 to 7 |
\x |
Group/subpattern number "x" |
|
|
Common Metacharacters
^ |
[ |
. |
$ |
{ |
* |
( |
\ |
+ |
) |
| |
? |
< |
> |
The escape character is usually \
|