Preview JavaScript regex replacement output with flags, capture groups and pasted sample text.
This tool previews a JavaScript regular expression replacement before you use it in code, spreadsheets, CMS cleanup or migration scripts. Enter the pattern, flags, replacement string and sample text to see the exact output.
Replacement syntax
JavaScript replacement tokens such as $1, $2, $& and $$ are supported by the browser engine.
Scope
The result follows JavaScript RegExp behavior. Other engines such as PCRE, Python and .NET can differ in lookbehind, named groups and replacement syntax.