Regex Tester

Test and debug JavaScript regular expressions as you type, with matches highlighted right in your sample text. Toggle the g, i, m, s, u, and y flags and inspect captured and named groups with their positions.

Flags

Find every match, not just the first

Type or paste the text to test. Matches for the pattern above are highlighted on the right.

Type a pattern, then paste the text to test it on. Matches are highlighted as you type.

Match Result

Matches are highlighted here as you type.

How to Use

  1. Enter regex pattern
  2. Enter text to test
  3. Set flags (g, i, m, etc.)
  4. Check match results and groups
  5. Real-time regex testing
  6. Match result highlighting
  7. Group analysis and extraction
  8. Various flag support
  9. Features

Testing and Debugging Regular Expressions

What this tester does

A regular expression is a compact pattern that describes a set of strings — the shape of an email, a date, a phone number, or any recurring text structure. This tool compiles the pattern you type using your browser's JavaScript regex engine and runs it against your sample text the moment you make a change, so there is no separate 'run' step. Every substring that matches is highlighted in place, and a Match Details panel lists each match with its captured groups and character position.

Because it uses the same engine that powers RegExp in JavaScript and Node.js, what you see here is exactly what your code will do.

When to use it

Reach for it whenever a pattern is not behaving the way you expected. Instead of scattering console.log statements and re-running a script, you paste representative text, adjust the pattern, and watch the highlights shift in real time. It is equally useful for building a pattern from scratch — start loose, then tighten it until only the intended matches light up.

The match and group counts under the editors help you spot an accidentally greedy quantifier or an over-broad pattern before it reaches production.

Example: matching a date

Suppose you want to pull ISO dates out of a log. The pattern (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) matches 2026-07-18 and splits it into three named groups: year, month, and day. With the g flag enabled, every date in the text is captured, not just the first. Swapping \d{2} for \d{1,2} would also accept single-digit months like 2026-7-8.

Notes and edge cases

Flags change everything: i makes the match case-insensitive, m lets ^ and $ anchor to each line, s allows the dot to match newlines, and u enables full Unicode handling. Remember that characters like . * + ? ( ) [ ] { } \ | ^ $ are special and must be escaped with a backslash to match them literally — to find a literal dot, write \. rather than ., which matches any character. Unnamed groups are numbered from 1 in the order their opening parenthesis appears, while (?:...) creates a group that does not capture.

Frequently Asked Questions

Yes — you can test as many patterns as you like against up to 100,000 characters of text, with match highlighting, group inspection, and live match counts all included. The first 1,000 matches are reported. There are no premium flags, saved-pattern limits, or accounts to create.