Regex Tester
Test regex with live match highlighting.
//g
How to use the Regex Tester
- 1 Enter your regular expression and flags.
- 2 Paste the test string below.
- 3 See matches highlighted and captured groups listed live.
Frequently asked questions
Which regex flavor does it use?
It uses the JavaScript (ECMAScript) regular-expression engine built into your browser, including flags like g, i, m, s and u.
What do the flags g, i and m do?
g finds all matches instead of stopping at the first, i makes matching case-insensitive, and m lets ^ and $ match at the start and end of each line rather than the whole string.
How do I use capture groups?
Wrap part of the pattern in parentheses to capture it, e.g. (\d{4}) captures a four-digit year. The tool lists each numbered group it captures for every match.