Developer tool

Regex Tester

Test regular expressions with live match highlighting.

Free Runs in your browser

Highlighted matches

Matches and groups

Replace

About this tool

Regex Tester shows every match of your regular expression as you type, with a table of capture groups and a replace preview. It uses the JavaScript regex engine in your browser, so results match what your code will do.

How to use Regex Tester

  1. Type a pattern or pick a preset.
  2. Paste the text you want to search.
  3. Read the highlighted matches and groups, or try a replacement.

Questions people ask

Which regex flavour does this use?

JavaScript (ECMAScript). Most syntax matches PCRE, Python and Java, but lookbehind support, possessive quantifiers and some flags differ between engines.

What do the g, i, m and s flags do?

g finds all matches instead of the first, i ignores case, m makes ^ and $ match at each line, and s lets the dot match new lines.

How do I use a capture group in the replacement?

Write $1, $2 and so on for numbered groups, $<name> for named groups like (?<year>\d{4}), and $& for the whole match.

More developer tools

See all 24 →
Esc