What it does
The tester runs your pattern with the browser's own JavaScript regular expression engine, so results match what your code will do in Node.js or a web page. Every match is highlighted, and a table lists its position, text, numbered groups and named groups.
Flags
- g finds all matches instead of only the first.
- i ignores upper and lower case.
- m makes
^and$match at each line. - s lets
.match line breaks. - u enables full Unicode matching, including
\p{L}property escapes.
Safety
Patterns run in a background worker with a 1.5 second limit. Some patterns, such as (a+)+$ on a long string of "a" characters, take exponentially longer as the text grows. If that happens the tester stops it and explains, instead of freezing your browser tab.
Safety check (ReDoS heuristic)
The Safety check reads your pattern into a small syntax tree and looks for shapes that are known to backtrack badly. It is a heuristic: not proof of safety.
What it checks
- Nested quantifiers on text that can be split in several ways, such as
(a+)+,(a*)*or(.*)*. - A repeated alternation whose branches overlap, such as
(a|aa)+. - Adjacent quantified tokens that can match the same characters, such as
.*.*orx+x+. - A greedy
.*without a^anchor in front of text that must still follow.
Each finding shows its position, why it is slow and, where one is obvious, a safer rewrite. The timing test then runs your pattern in the same background worker as the tester on generated strings (for example 30 to 40 repetitions of one character followed by a character that makes the match fail) and reports the time. A run that takes longer than 1.5 seconds is stopped.
What it cannot catch
- Dangerous patterns that do not fit these shapes. It can miss them.
- Harmless patterns that look like these shapes. It can flag them, for example when the surrounding text can never be reached.
- Back-references, lookarounds and Unicode property escapes are only partly modelled.
- Timing depends on your browser and device. A fast result on the generated strings says nothing about other input.
Test table
Each row has a test string and the result you expect (should match or should not match). Run table checks every row in the background worker with the same 1.5 second limit and shows pass, fail or timeout per row. Rows can be added, deleted and pasted as lines, and the table is also shown as JSON text that you can copy. The earlier Test cases section works as before. The table is not saved: it is gone when you close or reload the page.
Example: named groups and replace
This pattern captures the parts of an ISO date by name. The g flag finds every match:
(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})Against the text Released 2026-11-06 and patched 2025-01-31. the tester reports 2 matches at positions 9 and 32 and lists the numbered and named groups of each, for example group 1 and year are 2026, month is 11 and day is 06. The “What this pattern does” panel explains every token in plain English. With the replacement $<day>/$<month>/$<year> the result is:
Released 06/11/2026 and patched 31/01/2025.Catastrophic backtracking
The pattern (a+)+$ tested against a long run of “a” characters followed by a “b” is a well-known trap: the engine tries an exponential number of ways to match. The tester runs patterns in a background worker and stops after 1.5 seconds with this message: “Stopped after 1.5 seconds: this pattern is taking too long, which usually means catastrophic backtracking (for example nested quantifiers like (a+)+).” Your browser tab keeps working. Rewrite such a pattern so that nothing is nested inside a repeated group, or use the Safety check on this page.
Frequently asked questions
Which regex flavour does it use?
The JavaScript (ECMAScript) engine of your browser, so results match what your code will do in Node.js or on a web page. The code generator can also write the pattern for Python, Go, Java, PHP and C#, but those languages can behave differently in details.
What do the flags mean?
g finds all matches, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, and u enables full Unicode matching, including property escapes such as \p{L}.
Can I test several strings at once?
Yes. Use the test cases to check strings that should match and strings that should not, with a timeout so a runaway pattern cannot freeze the page.
Is my text uploaded?
No. Patterns and text stay in your browser.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.