Features
- Live highlightingSee matches and groups.
- SafeRunaway patterns are stopped after one second.
- Runs on your deviceYour data is processed in the browser and is never uploaded.
How to use the regex tester
- Enter the pattern without surrounding slashes.
- Set flags such as g, i or m.
- Paste test text and read the highlighted matches.
Catastrophic backtracking
Some patterns take exponential time on certain input. Matching runs in a background worker here and is stopped after one second.
Use a regular expression in JavaScript
for (const match of text.matchAll(/(\d+)-(\d+)/g)) {
console.log(match[0], match[1], match[2]);
}
Frequently asked questions
Which regex flavor is this?
JavaScript (ECMAScript). PCRE, Python and Go differ in places.
What does the g flag do?
It finds every match, not just the first.
How many matches are shown?
Up to 500 are highlighted and the first 50 listed.