Guide

TEXT & DEVELOPER REGEX · WEB WORKER REDOS-SAFE JAVASCRIPT TESTER

JavaScript Regex Tester,
match highlighter, groups & ReDoS safety.

Test JavaScript regular expressions with live match highlighting, numbered and named capture groups, safe replacement preview, JSON export, and 1.5s Web Worker timeout protection.

//

7 / 1,000 UTF-16 code units · 7 UTF-8 bytes

Flags:
Presets:

Test String

23 / 100,000 UTF-16 code units · 23 UTF-8 bytes

Ready to test in a timeout-protected Web Worker.

Match Preview & Groups

Click Test Expression (or press Enter in the pattern box) to run your regex safely inside a browser Web Worker.

JAVASCRIPT REGEXP FLAGS

Quick reference: JavaScript regex flags and what each one controls.

FlagNameWhat It Does
gGlobalFinds all matches instead of stopping after the first.
iIgnore CaseMatches uppercase and lowercase letters identically.
mMultilineMakes ^ and $ match the start and end of each line.
sDotAllAllows . to match newline characters (\n).
uUnicodeEnables full Unicode code points and property escapes like \p{L}.
yStickyMatches strictly at the exact current index without skipping ahead.

Related Developer & Text Tools

Web Worker Isolation

Every regex test runs in a background Worker capped at 1,500 ms and 500 matches so accidental catastrophic backtracking never locks your browser tab.

Frequently Asked Questions

Why does this regex tester use a Web Worker with a 1.5-second timeout?

Certain patterns with nested quantifiers (such as (a+)+$) can trigger catastrophic backtracking (ReDoS) and freeze a browser tab. Running your expression inside a dedicated Web Worker lets the tester automatically terminate runaway matches after 1.5 seconds.

Which regex engine does this tool use?

It runs your browser’s native JavaScript (ECMAScript) RegExp engine, supporting modern features like named capture groups (?<name>...), lookbehinds (?<=...), Unicode property escapes (u/v flags), and dotAll (s).

Why did my pattern only find one match?

Without the g (global) flag, JavaScript regular expressions stop after the very first match. Click the "g" flag pill to highlight all matches across the test string.

Can I preview search-and-replace substitutions?

Yes. Click "Replace Preview" to test replacement strings using $& (full match), $1–$9 (numbered capture groups), and $<name> (named capture groups) without risking ReDoS.

Does my test text leave my browser?

No. All regex matching, group extraction, and replacement previews run 100% locally in your browser with zero server requests.