Regex Tester

Test JavaScript regular expressions with live highlighting and capture groups.

What is a regex tester?

A regex (regular expression) is a pattern that describes a set of strings. It is one of the most powerful tools in a developer's kit — used for validation (emails, phone numbers), searching and replacing text, log parsing, and data extraction.

This tester highlights every match directly in your text and shows the capture groups for each match, so you can see exactly what your pattern does before you put it into code.

How to use this tool

  1. Type your pattern in the Regular expression box (without slashes).
  2. Set flags if needed: g global, i case-insensitive, m multiline, s dot-all.
  3. Paste test text and click Test.
  4. Matches are highlighted; the list below shows each match and its capture groups.

Frequently Asked Questions

What do the flags mean?

g finds all matches (not just the first), i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, u enables Unicode mode, y is sticky mode.

Why is nothing highlighted even though the regex looks right?

Check that the pattern is valid JavaScript syntax. If it is invalid, an error message shows below. Also confirm you selected the g flag to see all matches.

What are capture groups?

Parts of the pattern wrapped in parentheses, like (\d+). They capture portions of the match for extraction or replacement. The match list shows group values for each match.

Is my text sent to a server?

No. All regex testing happens locally in your browser. Your text never leaves your device.