Regex Tester
Test JavaScript regular expressions with live match highlighting, capture and named groups, flags, replace preview and a quick syntax cheat sheet. Free tool.
Runs in your browser. Nothing is uploaded.
About Regex Tester
Type a pattern and some test text, and every match is highlighted as you type. A table lists each match with its position and capture groups, including named groups, and a replace box previews the result of String.replace with $1 or $<name> references.
Toggle the g, i, m, s, u and y flags, start from presets for emails, URLs, dates and more, and use the cheat sheet for syntax you don't remember. It uses your browser's own JavaScript regex engine, so results match what your code will do.
How to use Regex Tester
- Open the tool above and add your file or text.
- Adjust the options to suit.
- Download or copy the result. Nothing is uploaded at any point.
Frequently asked questions
Which regex flavour is this?
JavaScript (ECMAScript), including lookbehind, named groups and Unicode property escapes. Most patterns also work in Python, Java and PCRE.
Why does my pattern only find one match?
Without the g (global) flag, JavaScript stops after the first match. Turn g on to find them all.
Is Regex Tester free and private?
Yes. Regex Tester is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.