Regex Tester and Replacer

This tool uses the browser's built-in ECMAScript (JavaScript) RegExp engine — what you verify here is exactly what your JavaScript program would do. Other regex flavours (PCRE, Python, Java, .NET) behave differently; patterns are not interchangeable. Everything runs on your device: the pattern and test text are never uploaded, stored, or placed in the URL.

Warning: a pathological pattern (for example nested quantifiers over a long text) can freeze this tab, because a JavaScript regular expression cannot be interrupted once started. This tool offers no "timeout" or "safe mode"; the input limits (pattern 500 characters, text 50,000 characters, replacement 1,000 characters, all counted in Unicode code points) are the only mitigation.

Flags
Presets (click to fill pattern and text; flags stay as set)
Highlighted result

ECMAScript flavour notes