=
regularexpressions
Start of string
Start of string
End of string
End of string
Word boundary
Not word boundary
Start of word
End of word
Control character
‘white space
Not white space
Digit
Not aigit
Word
Not word
Hexadecimal digit,
Octal digit
per:
lowers)
Calphac]
Eealnums]
E:aigit:}
[elit
:punct:]
[blank]
[spaces]
enti}
[graphs]
eprint:]
[:word:}
Upper case letters
Lower case letters
Al letters
Digits and letters
Digits
Hexadecimal digits
Punctuation
‘Space and tab
Blank characters,
Control characters
Printed characters
Printed characters and
spaces
Digits, letters and
underscore
Lookahead assertion
Negative lookahead
Lookbehind assertion
Negative lookbehind
COnce-only Subexpression|
Condition tif then}
Condition [if then else]
‘Comment
Available free from
ww tLovelackDaniels.com
‘ 0 or more
+ Lor more
? ort
By Exactly 3
B} 3 or more
85} 3,4 0r5
Quantifier Modifiers
"x" below represents a quantifier
2 Ungreedy version of
ena
\ Escape Character
Metacharacters (must be escaped)
t
{
\
1
y=
ee
Any character except
new line (\n)
(aib) aorb
Gd Group
Cd Passive Group
[abe] Range (a or b or ¢)
[sabe] Not aor bore
[aa] Letter between a and q
[AQ] Upper case letter
between A and Q
[0-7] Digit between 0 and 7
\n sith group/subpattern
Note: Ranges are inclusive.
es
Global match
Case-insensitive
Multiple fines
‘Treat string as sinle line
Allow comments and
white space in pattern
Evaluate replacement
Ungreedy pattern
xg Be
n
New line
vv Carriage return
\ Tab
Ww Vertical tab
Form feed
\yowe (étal character xxx
\xhh Hex character hh
oe
$n ‘ath non-passive group
92 sxye” in /(abelxyz2))$/
$1 "xyz" in /(2:abe)(xyz)$/
$ Before matched string
s After matched string
= Last matched string
$8 Entire matched string
Pattern
((A-Za-20-9514)
(ot arvretn,2>V\aray)
((\S]+(\.Upalifipng) \.\2)
(A[1-911)81911-4](1}[0-9}{1}$17508)
(#7({A-Fa-f0-9)) {3} (((A-Fe-f0-9]){3})?)
(Q=.\9)(?=.*fa-2})(2=."18-Z]).{8,15})
(WwWe@lazh-Z147VS20-2102,6))
( }4)\>)
extensively tested. Please use with caution
Note: These patterns are intended for reference purposes arid have not been
Will Match
Letters, numbers and hiyphens
Date (e.g. 21/3/2006)
§pg, gif or png image
Any number from 1 to 50 inclusive
Valid hexadecimal colour code
String with at least one upper case
letter, one lawer case letter, and one
digit (useful for passwords),
Email addresses
HTML Tags
and test thoroughly before use.