Regex Tester

Test regular expressions with real-time matching and highlighting.

//g

Replace (optional)

Quick reference

.any char
\ddigit
\wword char
\swhitespace
^start
$end
*0 or more
+1 or more

Useful regex patterns

PatternRegexExample Match
Email[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}user@example.com
Phone (US)\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}(555) 123-4567
IPv4 Address\b(?:\d{1,3}\.)\{3}\d{1,3}\b192.168.1.1
Date (ISO)\d{4}-\d{2}-\d{2}2024-03-15
Hex Color#[0-9A-Fa-f]{6}\b#FF5733

Frequently Asked Questions

What regex flavor does this tool use?

This tool uses JavaScript's native RegExp engine. It supports most common regex features including lookahead, lookbehind (in modern browsers), named groups, and Unicode escapes.

What do the flags mean?

g (global) finds all matches, i (case-insensitive) ignores case, m (multiline) makes ^ and $ match line boundaries, s (dotall) makes . match newlines, u (unicode) enables full Unicode support.

How do I use capture groups in replacement?

Use $1, $2, etc. for numbered groups, or $<name> for named groups. For example, pattern "(\w+)" with replacement "[$1]" wraps each word in brackets.

Why isn't my regex matching?

Common issues: forgetting to escape special characters (use \. for literal dot), case sensitivity (add i flag), or the pattern doesn't account for whitespace/newlines.

Is my data private?

Yes. All regex testing happens entirely in your browser. Your patterns and test strings are never sent to any server.

Related Tools