This is a JavaScript regular expression tester
Patterns run through your browser's own RegExp engine, which implements ECMAScript regular expressions. That matters more than it sounds: a pattern that works here will not necessarily behave the same way in PCRE, Python's re, .NET, Go or Java.
Notable differences you may hit: ECMAScript has no atomic groups or possessive quantifiers, no recursion, and no \A/\z anchors. Lookbehind is supported in modern browsers. Named groups use (?<name>…) and are referenced in a replacement as $<name>.
Codoryn does not claim PCRE compatibility, and it never rewrites your pattern to make it work.
How to use it
- Type a pattern — write it as you would between the slashes, without the surrounding
/. - Toggle the flags you need.
gis on by default so you see every match rather than only the first. - Paste or type the text to test against, or press Sample.
- Switch to Replace to preview a substitution, using
$1,$<name>and$&as normal. - Press Run regex or Ctrl/Cmd + Enter.
Why a pattern can time out
Some patterns take exponentially longer as the input grows. The classic shape is a quantifier inside another quantifier over overlapping alternatives — (a+)+$ against a long run of as is the textbook example. This is called catastrophic backtracking, and on a normal page it locks the tab.
Codoryn evaluates every pattern in a Web Worker with a 1500 ms deadline. If a run exceeds it, the worker is stopped and the page stays responsive; you get a clear timeout message instead of a frozen browser. Your next run starts on a fresh worker.
If you hit the timeout, the usual fixes are to anchor the pattern, replace a nested quantifier with a more specific character class, or make an alternation unambiguous.
Capture groups
Numbered groups appear as $1, $2 and so on, in the order their opening parentheses appear. Named groups appear under their own name. A group that took part in the match but captured nothing is shown as (no match), which is different from capturing an empty string.
In Replace mode the standard replacement tokens apply: $& for the whole match, $1 for a numbered group, $<name> for a named one, and $$ for a literal dollar sign.
Limits
- Test text: up to 1 MB. Larger input is refused rather than risking an unresponsive tab.
- Pattern: up to 16 KB.
- Displayed matches: the first 1000 are listed, but the reported count is always the true total. The result says so when the list is truncated.
- Run time: 1500 ms per run.
Frequently asked questions
Is my pattern or test text uploaded?
No. Everything runs in a Web Worker in your browser, and this tool does not send the pattern, the text, the replacement or the results over the network.
Why does an empty pattern show nothing instead of an error?
Because you have not asked anything yet. An empty pattern is a neutral starting state, not a mistake.
Why does my zero-width pattern report so many matches?
A pattern that can match the empty string — a* for example — matches at every position, including between characters and at the end of the text. That is correct ECMAScript behaviour, not a bug.