Enter a pattern and flags (g, i, m, s, u) and the text to search. Each match is listed with its index and any capture groups. The syntax is JavaScript's, which is close to but not the same as Python's or PCRE.
How it works
The tester runs your pattern with the browser's own regular expression engine, so results match what the same pattern does in JavaScript and TypeScript.
Without the g flag only the first match is shown. Add m to make ^ and $ match at every line, s to let . match line breaks, and u for full Unicode.
Patterns with nested repeats such as (a+)+ can take exponential time on some inputs; avoid them in code that handles user input.
Examples
(\d+)-(\d+)
g
pages 10-12 and 40-45Match 1 at 6: "10-12"
groups: $1="10", $2="12"
Match 2 at 16: "40-45"
groups: $1="40", $2="45"These examples are run by the tool itself in our automated tests, so the results shown are what it really returns.
Guides that use this
- How to clean a messy CSV before you analyse it — 2 min read
More tools
Legal entity
Devansh Yadav
Moradabad, Uttar Pradesh
Governing law: Courts at Moradabad, Uttar Pradesh
Phone: +91 8433475698
Legal: legal@analyzeit.in