Regex Tester
Write a regular expression and test it against a sample string. Matches will be highlighted and positions shown below.
/yourPattern/g
Type a pattern to see an explanation...
Regex Cheat Sheet
\d
— Digit (0–9)\w
— Word character (a-z, A-Z, 0–9, _)\s
— Whitespace.
— Any character except newline^
— Start of string$
— End of string[abc]
— a, b, or c[^abc]
— Not a, b, or ca|b
— a or b(abc)
— Group?
— Zero or one*
— Zero or more+
— One or more{n}
— Exactly n{n,}
— n or more{n,m}
— Between n and m