Regex Tester

Regex tester

Write a pattern, set your flags, and watch matches highlight live as you type — with capture groups broken out.

▌ Test string0 matches
▌ Highlighted matches

Test as you type

Regular expressions are famously hard to get right by reading alone — you really need to see them run. Enter a pattern and some test text and every match highlights instantly, with a running count and the contents of any capture groups listed below. Adjust the flags to change behaviour: g finds all matches, i makes it case-insensitive, m treats each line separately, and s lets the dot match newlines.

Building patterns with confidence

The fastest way to build a tricky pattern is incrementally: start broad, watch what matches, then tighten. Capture groups (the parts in parentheses) are shown separately so you can confirm you're extracting exactly the pieces you want — invaluable when you're using a regex for find-and-replace or pulling fields out of text. This uses your browser's own JavaScript regex engine, so what you see here is exactly how it'll behave in JavaScript code.

FAQ

Which regex flavour does this use?
It uses the JavaScript (ECMAScript) regex engine built into your browser, so results match what you'd get in JavaScript. Most patterns also transfer closely to other languages.
What do the flags mean?
g matches all occurrences, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, and u enables full Unicode handling.

Related tools