Very Simple jQuery based regular expression testing tool. Use this tool to create and test regular expression pattern on string.
Meta Characters | |
---|---|
^ | Start of subject (or line in multiline mode) |
$ | End of subject (or line in multiline mode) |
[ | Start character class definition |
] | End character class definition |
| | Alternates ( a|b matches a or b ) |
( | Start subpattern |
) | End subpattern |
\ | Escape character |
Base Character Classes | |
---|---|
\w | Any "word" character (a-z 0-9 _) |
\W | Any non-"word" character |
\s | Whitespace (space, tab, CRLF) |
\S | Any non-whitespace character |
\d | Digits (0-9) |
\D | Any non-digit character |
. | Any character except newline |
Quantifiers | |
---|---|
* | Zero or more |
+ | One or more |
? | Zero or one occurrence |
{n} | n occurrences exactly |
{n,} | At least n occurrences |
{,m} | At most m occurrences |
{n,m} | Between n and m occurrences inclusive |
Subpatern Modifiers & Assertions | ||
---|---|---|
(?:) | Non capturing subpattern | ((?:foo|fu)bar) matches foobar or fubar without foo or fu appearing as a captured subpattern |
(?=) | Positive look ahead assertion | foo(?=bar) matches foo when followed by bar |
(?!) | Negative look ahead assertion | foo(?!bar) matches foo when not followed by bar |
(?<=) | Positive look behind assertion | (?<=foo)bar matches bar when preceded by foo |
(?<!) | Negative look behind assertion | (?<!foo)bar matches bar when not preceded by foo |
(?>) | Once-only subpatterns | (?>\d+)bar Performance enhancing when bar not present |
(?(x)) | Conditional subpatterns | (?(3)foo|fu)bar Matches foo if 3rd subpattern has matched, fu if not |