Handytool
DeveloperFreeRuns locally

Regex tester

Test JavaScript regular expressions against any text — see matches, capture groups, and replacements live, in your browser.

//g
Flags
Test string
Matches · 0 match(es)
Replace result

About the Regex tester

Handytool's regex tester lets you build and debug JavaScript regular expressions against any test string in real time. Toggle every flag (g, i, m, s, y, u), see numbered capture groups for each match, and try a replacement template with $1, $2 placeholders side by side. The pattern is evaluated by your browser's native RegExp engine, so what you see here matches exactly what your code will do in production.

Regex tester features

  • 01

    Live matches and capture groups

    Every keystroke re-runs the pattern. Each match shows its index in the input plus all captured groups, so you can confirm structure as you tune the expression.

  • 02

    All JavaScript flags

    Flip g, i, m, s, y, and u individually. Sticky and unicode flags are included so you can reproduce exactly what your application code uses.

  • 03

    Replacement preview

    Type a replacement string with $1, $2, $& and friends to see the substituted output update live — handy for one-off bulk text edits or sanity-checking a complex transform.

Regex tester FAQ

Which regex flavor does this tester use?
JavaScript (ECMAScript). Patterns are evaluated by the browser's native RegExp engine, so behavior matches Node.js and any modern browser. Lookbehinds, named groups, and Unicode property escapes (\p{…} with the u flag) are supported.
Does my pattern or test string leave the page?
No. Everything runs locally in your browser — no network requests are made when you type a pattern, change flags, or preview a replacement.
How do I use capture groups in the replacement field?
Use $1, $2, … to reference numbered capture groups, $& for the whole match, and $$ to insert a literal $. The replacement preview updates live as you change either the pattern or the template.
Why is my regex not matching across line breaks?
By default the dot (.) doesn't match newline characters. Enable the s (dot-all) flag, or use [\s\S] to match any character including newlines.
Does this work for Python or PCRE patterns?
The engine is JavaScript, so most basic patterns behave identically, but features like (?P<name>…) named groups (Python) or possessive quantifiers (PCRE) are not supported. Use the equivalent JS syntax: (?<name>…) for named groups.

Related tools

Developer

Explore other tools

All tools