Regular Expression Checker in Javascript
Test String
Search for this
Regular Expression Pattern
Examples of Regular Expressions
a
[^a] - NON a anywhere
^a - starts with an a
^[^a] - does not start with an a
abc - abc anywhere
[abc] - a OR b OR c anywhere
^abc - abc at the beginning
^abc|^pqr - abc OR pqr at the beginning
[^abc] - ANYTHING BUT abc anywhere
^[^abc] - does not start with abc
[a-z] - a-z anywhere
[a-zA-Z0-9_] - ANY alphanum (see shortcut)
[^a-zA-Z0-9_] - NON alphanum anywhere (see shortcut)
a{2} - Exactly 2 consecutive a's
a{2,} - At least 2 consecutive a's
a{2,5} - At least 2, at most 5 consecutive a's
HREF=\"\/{1,2} - NOT (HREF="/* or HREF="http://*)
Result
Shortcuts
Case Sensitive!
\w - ANY alphanum anywhere
\W - NON-alphanum anywhere
\d - ANY digit anywhere
\D - NON-digit anywhere
Operators
^ - negation
^[ ] - first
$ - end
a* - 0 or more times a (Kline*)
a+ - 1 or more times a
a? - O or 1 times a
.a - a preceded by anything but newline
Special Chars
\/ - /(front slash) - \ precedes the special char
\t - tab
\n - linefeed
\r - carriage return
\f - from feed
\v - vertical tab
\b - backspace
\\bn - word boundary beginning n
\s - single whitespace (space,rab,lf,cr,ff)