Regex tester
Live test JavaScript regular expressions. Type a pattern, pick flags, paste a test string; matches are highlighted in the text, capture groups and positions are listed below. A replace string shows what String.replace() would produce. Runs entirely in your browser; no input is sent to a server.
Quick reference
\ddigit ·\wword char ·\swhitespace ·.any one char[abc]set ·[^abc]not-in-set ·[a-z]range^start ·$end ·\bword boundary?0 or 1 ·*0 or more ·+1 or more ·{n,m}between n and m(abc)capture ·(?:abc)non-capture ·(?<name>abc)named capture(?=abc)lookahead ·(?!abc)negative lookahead