Regular Expressions to keep

^Start of string
\AStart of string
$End of string
\ZEnd of string
\bWord boundary
\BNot word boundary
\<Start of word
\>End of word
Character Classes
\cControl Character
\sWhite Space
\SNot white Space
\DNot digit
\WNot word
\xHexadecimal digit
\OOctal digit
?=Lookahead assertion
?!Negative lookahead
?<=Lookbehind assertion
?!= or also ?Negative lookbehind
?>Once-only Subexpression
?()Condition [If Then]
?()|Condition [If Then Else]
*0 or more occurences
+1 or more occurences
?0 or 1 occurences
{5}Exactly 5 occurences (or any other number instead of 5)
{5,}5 or more occurences
{5,8}5, 6, 7 or 8 occurences
Quantifier Modifiers
x?Ungreedy version of "x", where x is a quantifier (see before)
Escape Character
/Escape one character
Note that all of these characters need to be escaped (see escape character above)
Patter modifiers
gGlobal match
iMake case-insensitive
mMatch multiple lines
sTreat a string as a single line
xAllow the occurence of whitespace and comments in the string
eEvaluate the replacement
UUse an Ungreedy pattern
Special characters
\rCarriage return
\vVertical tab
\fForm feed
\xxxOctal character xxx
\xhhHex character hh
Ranges and groups
.Matches all characters except newline
(x|y)Matches x or y
(...)A group, matches the group exactly (xyz) matches 'xyz'
(?:...)Lazy group, matches every occurence of group, not only the first and the last (as greedy does)
[xyz]Range, matches x, y or z
[^xyz]Negative range, matches NOT x, y or z
[a-z]Matches any letter between a and z
[A-Z]Matches any upper case letter between a and z
[0-9]Matches any number between 0 and 9 (digit)
\xMatches the "x"-th occurence of the pattern
Replacing Strings
$xReplaces "x"-th non-passive group that matches
$2Replaces "def" in /^(abc(def))$/
$1Replaces "def" in /^(?:abc(def))$/
$`Replaces before the matched string
$'Replaces after the matched string
$+Replaces the last matched string
$&Replaces the entire matched string