-
Pattern
-
.
-
Matches any Char (use m flag to match linebreaks)
-
\w\W
-
Word char & not word char
-
\d\D
-
Digit & not digit
-
\s\S
-
Whitespace char & not whitespace char
-
[]
-
matching set
-
[^]
-
Not matching set
-
[x-y]
-
Range can be alpha or numberic
-
\t
-
tab
-
\r
-
return
-
\n
-
newline
-
\xXX
-
Hex index selector
-
\
-
escape
-
^
-
Begins with
-
$
-
Ends with
-
(?=ABC)
-
Positive Lookahead
-
(?!ABC)
-
Nagative Lookahead
-
(?<=ABC)
-
Positive Lookbehind
-
(?<!ABC)
-
Negative Lookbehind
-
?
-
Optional (Lazy)
-
*
-
0 or more (add ? to make lazy)
-
+
-
1 or more (add ? to make lazy)
-
{x}
-
Matches exactly x amount
-
{x,y}
-
Matches between x and y amounts (add ? to make lazy)
-
()
-
Capturing Group
-
(?:)
-
Non-capturing Group
-
|
-
Or
-
\x
-
Inserts the x number of capture group for select
-
Replace Functions:
-
$
-
Insertion ($$ to escape) for Replace
-
$&
-
Inserts matched substring
-
$`
-
Inserts proceeding
-
$'
-
Inserts following
-
$1
-
Inserts first capture group
-
-
^\d{3}([-\.]?)\d{3}\1\d{4}$
-
Text to match against
888-888-8888