Test regular expressions against sample text, see every match and capture group, preview replacements and copy code in four languages.
The regex tester evaluates a regular expression against your sample text as you type. Enter a pattern and flags such as g, i, m or s, and the tool lists each match with its capture groups. If the pattern is invalid, the error message is shown so you can fix it. A replacement field lets you preview the text after a find-and-replace, with $1, $2 and other group references supported.
Once the pattern works, switch to the code panel to get a ready-to-use snippet in JavaScript, Python, Go or Java that runs the same pattern, and copy it with one click. Matching uses your browser's JavaScript regex engine, so behavior can differ slightly in other languages for advanced features.
Matching uses the JavaScript regex engine in your browser. Most common syntax works the same in Python, Go and Java, but some advanced features differ.
Use $1, $2 and so on for numbered groups, just as in JavaScript's replace method.