Regular Expression Tester
Write a pattern, pick flags, and see every match, capture group and replacement result update as you type.
How it works
This tester uses your browser's own JavaScript regular expression engine, so results match what you will get in Node.js and front-end code. Common building blocks: \d digits, \w word characters, \s whitespace, . any character, + one or more, * zero or more, ? optional, ( ) capture group, (?: ) non-capturing group, [a-z] character class, ^ and $ anchors.
Flags: g find all matches, i ignore case, m multiline anchors, s dot matches newline, u full Unicode.
Frequently asked questions
Why does my regex only find one match?
You need the g (global) flag to find all matches.
Does this support lookbehind and named groups?
Yes, in any modern browser. Named groups use (?<name>...) and lookbehind uses (?<=...) or (?<!...).
Why is my regex slow or freezing?
Nested quantifiers such as (a+)+ can cause catastrophic backtracking. Make the pattern more specific.