Regex Tester
Test a regex against your text live — matches highlighted, counted, with captured groups.
The result appears here.
A regular expression is a compact pattern for matching text. Type a pattern and some text and this tester highlights every match in real time, counts them, and lists the captured groups for each one. Use the flag checkboxes to ignore case, switch ^/$ to per-line anchors (multiline), or let . match across newlines. It uses the JavaScript regex engine — the same one in your browser and Node.js — so a pattern that works here works in your JS code. Everything runs in your browser: nothing you type is uploaded, and it keeps working offline once loaded.
Frequently Asked Questions
What is a regular expression?
A regular expression (regex) is a compact pattern that describes a set of strings. Instead of searching for one fixed word, you describe its shape — for example \d{4} matches any four digits and [A-Za-z]+ matches a run of letters. Regex is built into nearly every language and editor and is used for searching, validating input, extracting fields and find-and-replace. This tester uses the JavaScript regex engine, the same one your browser and Node.js use, so what works here works in your JS code.
What do the flags do?
Ignore case (i) makes the match case-insensitive. Multiline (m) makes ^ and $ match at the start and end of every line rather than only the whole string. Dot matches newline (s) makes the . wildcard also match newline characters so a pattern can span line breaks. This tester always searches globally, finding every match rather than stopping at the first, which is what lets it highlight and count them all.
What are captured groups?
Parentheses create a capturing group, which remembers the part of the match they enclose. For example (\d{4})-(\d{2})-(\d{2}) against 2026-06-27 captures 2026, 06 and 27 as groups 1, 2 and 3. This tester lists the captured groups for each match underneath the result, so you can confirm your pattern grabs the right pieces before you use it for extraction or replacement.
Is my text private?
Yes. The pattern and the text you test are processed entirely in your browser with the built-in JavaScript regex engine — nothing is sent to a server, logged or stored, and there is no account or sign-up. That makes it safe to test patterns against log lines, config snippets or other data you would rather not upload, and it keeps working offline once the page has loaded.