Regex Tester

Real-time regex tester with match highlighting, capture group display, flag toggles (g, i, m, s), and a handy regex cheat sheet sidebar.

//
gGlobaliCase-insensitivemMultilinesDotAll
Contact us at hello@example.com or support@test.org for help.
#1hello@example.comindex 14
Group 1: helloGroup 2: example.com
#2support@test.orgindex 35
Group 1: supportGroup 2: test.org
.Any character except newline
\dDigit (0-9)
\wWord character (a-z, A-Z, 0-9, _)
\sWhitespace (space, tab, newline)
^Start of string/line
$End of string/line
*0 or more of preceding
+1 or more of preceding
?0 or 1 of preceding
[]Character class
()Capture group
|Alternation (OR)
{n}Exactly n of preceding
{n,m}Between n and m of preceding
\bWord boundary

How to Use Regex Tester

  1. Enter your regular expression pattern in the regex input field.
  2. Toggle flags: g (global), i (case-insensitive), m (multiline), s (dotAll).
  3. Paste or type your test string in the text area.
  4. Matches are highlighted in real-time with different colors for capture groups.
  5. View match details including group captures, index positions, and match count.
  6. Reference the cheat sheet for common regex patterns.

Frequently Asked Questions

What regex flags are available?

The tester supports four flags: g (global - find all matches), i (case-insensitive), m (multiline - ^ and $ match line boundaries), and s (dotAll - dot matches newlines).

What are capture groups?

Capture groups are portions of a regex pattern enclosed in parentheses (). They let you extract specific parts of a match. The tool displays each group's content separately.

Does this use JavaScript regex syntax?

Yes, this tool uses JavaScript's built-in RegExp engine, so patterns follow ECMAScript regex syntax.