Regex Tester

Test JavaScript regular expressions with live match highlighting, capture groups, and flag controls. Runs entirely in your browser.

//

Match highlights

3 matches
Contact [email protected] or [email protected] for support. Reach us at [email protected] anytime.

Capture groups

#MatchPositionGroup 1Group 2
1[email protected]8aliceexample.com
2[email protected]29bobcompany.org
3[email protected]70supporttoolscoder.com

Quick reference

\dAny digit (0–9)
\wWord character (letter, digit, _)
\sWhitespace (space, tab, newline)
.Any character except newline (with s flag: any)
^Start of string (or line with m flag)
$End of string (or line with m flag)
*Zero or more of the preceding
+One or more of the preceding
?Zero or one of the preceding
{n,m}Between n and m of the preceding
[abc]Any of: a, b, or c
(abc)Capture group
(?:abc)Non-capturing group
(?<name>abc)Named capture group
a|ba or b

Frequently Asked Questions

What flags are available?+

g (global) — find all matches instead of stopping at the first. i (case-insensitive) — treat uppercase and lowercase as equal. m (multiline) — make ^ and $ match the start and end of each line, not just the whole string. s (dotAll) — make the . character match newlines as well as other characters. u (unicode) — enable full Unicode matching with correct handling of astral-plane characters.

Why do some special characters need to be escaped?+

In a regular expression, characters like . * + ? ( ) [ ] { } \ | ^ $ have special meaning. To match them literally, prefix them with a backslash: \. matches a literal dot, \( matches a literal parenthesis. This tester accepts the pattern without surrounding slashes — just the pattern content.

What are capture groups?+

Parentheses in a pattern create capture groups that extract substrings from each match. The group /(\w+)@(\w+)/ applied to "user@host" captures "user" as group 1 and "host" as group 2. Named groups use the syntax (?<name>pattern) and appear with their name in the results.

Is my text sent to a server?+

No. All matching runs in your browser using the built-in JavaScript RegExp engine. Your pattern and test text never leave your device.

How to use

  • Enter your regex pattern — no surrounding slashes needed.
  • Toggle flags with the buttons: g, i, m, s, u.
  • Paste your test string — matches highlight instantly.
  • Capture groups appear in the table below the highlighted output.