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?
Flags change how the pattern is applied. Ignore case (i) makes the match case-insensitive, so Cat matches cat and CAT. Multiline (m) makes the anchors ^ and $ match at the start and end of every line rather than only the whole string, which matters when your text has several lines. Dot matches newline (s, also called dotall) makes the . wildcard also match newline characters, so a pattern can span across line breaks. This tester always searches globally, meaning it finds every match in the text rather than stopping at the first, which is what lets it highlight and count them all.
What are captured groups?
Parentheses in a pattern create a capturing group, which remembers the part of the match they enclose so you can pull it out separately. For example (\d{4})-(\d{2})-(\d{2}) matched against 2026-06-27 captures 2026, 06 and 27 as group 1, group 2 and group 3. This tester lists the captured groups for each match underneath the result, so you can confirm your pattern is grabbing the right pieces before you use it in code for extraction or replacement. Groups are also what power back-references and replacement templates like $1 in most languages.
Is my text private?
Yes — the regex tester keeps your text private. 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. Because the work is local, the tester also keeps working offline once the page has loaded. An invalid pattern simply shows an error message and never affects anything outside the page.