Regex Studio

JavaScript / ECMAScript regex, in your browser

Write a regular expression and see it light up your test text live. Get a plain-English breakdown, a structure diagram, a substitution preview, and a heads-up if the pattern looks prone to catastrophic backtracking. This runs the browser's native JavaScript regex engine, so what you see here is exactly what your JavaScript code will do.

/ /
Load a tested pattern
Everything runs locally in your browser. Your pattern and test text are never sent anywhere.
Test text & live matches
Match details
Explanation
Structure diagram
Substitution preview
Uses String.prototype.replace. Refer to groups with $1 (numbered) or $<name> (named). $& is the whole match. With the g flag every match is replaced, otherwise only the first.