Free Online Regex Tester — Safe and Local
Runs in this tab. A token, a key, a config — whatever you paste stays local.
Loading the tool…
How it works
JavaScript RegExp, and its flags
This is the ECMAScript flavour, the one that runs in browsers and Node — not PCRE, not RE2, not POSIX. The differences are real: JavaScript has no atomic groups, no possessive quantifiers and no recursion, and lookbehind is comparatively recent. A pattern that works in a PHP or Python tester can behave differently here, so test in the flavour you will actually ship.
- g
- Global — find every match rather than the first. It also makes the regex stateful via lastIndex, a classic source of skipped matches in loops.
- i / m
- Case-insensitive, and multiline so ^ and $ match at each line break instead of only at the ends of the string.
- s / u / y
- Dot-all so . matches a newline; Unicode mode for \p{…} property escapes and correct surrogate handling; sticky to anchor at lastIndex.
- Capture groups
- (…) captures, (?:…) groups without capturing, (?<name>…) captures by name. Each match's groups are listed separately.
- Backtracking
- Nested quantifiers like (a+)+b make the engine explore exponentially many paths — catastrophic backtracking, the basis of ReDoS.
How to use it
How to test a regex online
- 01
Write the pattern
Without the surrounding slashes; flags are separate toggles.
- 02
Paste realistic sample text
Include the awkward cases, not just the ones you expect to match.
- 03
Read the matches
Each match shows its position and its capture groups, named ones included.
Where it earns its keep
Where a regex tester saves time
- Working out a log line parser before putting it in a pipeline.
- Checking a validation pattern against inputs that should fail as well as pass.
- Building a find-and-replace for a large refactor and proving it on a sample first.
- Understanding a regex someone else wrote by watching what it captures.
Questions
Regex Tester, answered
What happens if my pattern never finishes?
Execution runs in an isolated Web Worker with a time limit. If the pattern exceeds it the worker is terminated and you are told, rather than the tab freezing — which is what happens in a tester that runs the regex on the main thread.
Is my sample text uploaded?
No. The pattern and the text stay in this browser tab, so pasting a chunk of a production log to test against does not send it anywhere.
Does it support PCRE or Python syntax?
No. It is the JavaScript RegExp engine only. Recursion, atomic groups and possessive quantifiers do not exist here, and some \p{…} categories differ. Test against the engine you will deploy on.
What is catastrophic backtracking?
A pattern whose alternatives can match the same text in exponentially many ways — (a+)+$ against a long run of a's is the standard example. On attacker-controlled input it is a denial-of-service bug, which is why the timeout here is a feature rather than a limit.