Regex Tester

Free

Test and debug regular expressions instantly. See matches highlighted in real time.

//g
Flags:

How to Use This Regex Tester

  1. Enter your regular expression pattern in the pattern field.
  2. Toggle flags (g, i, m, s, u) as needed.
  3. Type or paste the text to test against in the test area.
  4. Matches are highlighted in real time as you type.
  5. The match details panel shows each match, its index, and any capture groups.

Common Regex Patterns

Email^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$
URLhttps?:\/\/[\w\-]+(\.[\w\-]+)+[\/\w\-?=&#.]*
IPv4\b(?:\d{1,3}\.){3}\d{1,3}\b
Hex color#[0-9a-fA-F]{3,6}\b

Frequently Asked Questions

What regex flavour does this tool use?

This tool uses JavaScript (ECMAScript) regular expressions, which are supported natively in all modern browsers. JavaScript regex supports most common features: character classes, quantifiers, groups, lookaheads, and lookbehinds.

What do the flags mean?

g (global) finds all matches. i (case insensitive) ignores letter case. m (multiline) makes ^ and $ match start/end of each line. s (dotAll) makes . match newline characters. u (unicode) enables full Unicode support.

How do I match a literal special character?

Escape it with a backslash. For example, to match a dot (.) literally, use \. To match a parenthesis, use \( or \).

What are capture groups?

Capture groups are portions of a regex wrapped in parentheses that capture the matched text. For example, (\d{4}) captures a 4-digit year. Named groups use the syntax (?<name>pattern). This tool shows captured groups in the match details.

Can I use this to test email or URL validation regex?

Yes. Paste your validation regex and test it against sample inputs to see which strings match and which do not. This is useful for validating email addresses, URLs, phone numbers, postal codes, and more.

Related Tools