Regex Tester

Regular expressions are notoriously easy to get subtly wrong. This tool highlights every match live as you type your pattern and sample text, lists each match with its capture groups, and reports a clear error if the pattern itself is invalid — all in JavaScript's own regex engine, so it behaves exactly like your code will.

//g

How to use

  1. Type a regex pattern (without the surrounding slashes) and pick flags (g, i, m, s...).
  2. Paste sample text — matches highlight instantly.
  3. Check the match list below for each match's position and capture groups.

FAQ

Which regex flavor does this use?

JavaScript's native RegExp engine — the exact same one your browser or Node.js code runs, so a pattern that works here will work identically in your app.

What do the flags mean?

g (global) finds all matches instead of stopping at the first; i (case-insensitive); m (multiline, ^ and $ match line boundaries); s (dotall, . matches newlines too).

Why does my pattern show an error?

JavaScript's regex parser rejects invalid syntax (e.g. unbalanced parentheses, a bad escape sequence) — the exact error message from the engine is shown so you can fix it.