Text & development / Regex Desk

Test a regex and see the text it changes

Preview JavaScript regular-expression matches, captured groups, and replacements locally. Export complete match tables or replaced text with bounded, cancellable runs.

01

Text, pattern, replacement

JavaScript regular expressions. Global (g) and Unicode (u) matching are always enabled.

Your text stays on this device. Run a pattern to inspect its matches.

02

See exactly what matched

A pattern you can inspect

Try the change before you keep it.

Test a JavaScript regular expression against your text, inspect the matching positions and groups, and preview a replacement. Download the changed text or a complete table of matches.

Runs happen in a separate browser worker with a short time limit. Editing inputs, cancelling, or hiding the tab stops a pending run.

How do replacement tokens work?

In substitution mode, $& inserts the full match, $1–$99 insert numbered groups, $<name> inserts a named group, and $$ inserts one dollar sign. The prefix and suffix tokens $` and $' are also supported. Literal mode inserts the replacement exactly as typed. Backslash escapes such as \n are not expanded in replacement text; press Enter to insert a real newline.

Which regex flavor does this use?

Your browser's JavaScript RegExp engine, with g and u always on and optional i, m, and s. It does not emulate PCRE, Python, or another language. Enter the pattern itself without enclosing slashes. Empty-position patterns such as (?:) are supported.

What are the limits?

Input is limited to 100,000 UTF-16 units, patterns to 1,000, replacements to 2,000, and output to 500,000. Runs allow up to 5,000 matches and 50 capturing groups, with additional capture-data limits. Most ordinary characters use one UTF-16 unit; many emoji use two. A run that exceeds a limit reports an error and does not offer a partial export.

Why did my run stop?

A pattern can take a long time even on short text. The tool stops a pending worker after roughly 1.5 seconds while the tab is active. Simplify the expression, reduce the input, or narrow what it matches. The interface stays available so you can edit and try again.