Developer Tools

Regex Tester

Try a regular-expression pattern and flags against sample text before putting it into code. Matching results are capped so a large input cannot flood the page.

StatusValid regex
Matches4
#MatchIndexCapture groups
1Crunch0—
2Anything7—
3Test20—
4Regex25—

How this tool works

The browser compiles a JavaScript RegExp and iterates global matches, recording each matched substring, index and capture groups.

Example

Use \b[A-Z][a-z]+\b with the g flag to find capitalized words and inspect where each match begins.

Common questions

Which regex flavor is used?

The tool uses the JavaScript regular-expression engine provided by the browser.

Why are results capped?

A result limit keeps accidental broad patterns from creating thousands of table rows in the page.