Text Utilities

Regex Tester

Test regular expressions with live match highlighting, capture group inspection, and common pattern presets.

0 chars
0 matches
No matches found.

How to use this tool

  1. Type or paste the text you want to search into the Test Text box.
  2. Enter your regular expression in the Regex Pattern field — highlighting updates live as you type.
  3. Toggle the g, i, m, s, and u flags to change matching behavior (global, case-insensitive, multiline, dotall, Unicode).
  4. Pick a common pattern from the Presets dropdown — Email, URL, Phone (US), IPv4, Date, or Hex Color.
  5. Review the Highlighted Matches panel for a live view of every match, then check Capture Groups to see each group's value.
  6. Use Copy to copy the test text, or Clear to reset it and start over.

Why this tool is helpful

Debug patterns instantly

See matches and capture groups update as you edit, so you can refine a pattern without rebuilding an app or adding logging.

Visualize what a regex matches

Live highlighting shows exactly which substrings each pattern hits — far easier to read than staring at raw match output.

Inspect capture groups

Confirm exactly what each parenthesized group extracts before wiring the pattern into parsing or replacement code.

Test common validation patterns

Try the built-in presets for email, URL, phone, IPv4, date, and hex color against real data before shipping them.

Experiment with flags

Toggle g, i, m, s, and u to see how case-sensitivity, multiline, dotall, and Unicode change results.

Stay private

Everything runs in your browser. Your patterns and text are never uploaded, logged, or sent to a server.

FAQ

What does this tool do?

It compiles your pattern into a JavaScript RegExp, runs it against the text you provide, highlights every match, and lists the capture groups for each match.

What do the flag checkboxes (g, i, m, s, u) mean?

g is global (find every match, not just the first), i is case-insensitive, m makes ^ and $ match at line boundaries, s lets . match newlines, and u enables full Unicode matching. Only g is on by default.

Why do I get "Invalid regex"?

Your pattern has a syntax error — for example an unclosed group or an invalid quantifier. The message shows the browser's error, and the match count reads Error until you fix it.

What's the difference between a match and a capture group?

A match is the whole substring the pattern found. Capture groups are the parts inside parentheses (…), listed as Group 1, Group 2, and so on — useful for pulling out just the pieces you need.

Do I need leading and trailing slashes in my pattern?

No. Enter just the pattern body, for example \d{3}-\d{4}, without /.../ delimiters. The pattern is passed directly to the JavaScript engine.

Does it support Unicode, lookbehind, or other modern features?

Whatever your browser's JavaScript engine supports works here, since the pattern compiles to a native RegExp. Enable the u flag for proper Unicode handling of emoji and astral characters.

Does any of my data leave my browser?

Never. All matching happens locally in JavaScript. Your text and patterns are not sent to, stored on, or logged by any server.