Regex Tester

Test regular expressions with real-time matching, highlighted results and capture groups. Everything runs in your browser.

Enter a regex pattern and test text below. Results update in real time as you type. Supports JavaScript regex syntax with flags g, i, m, s.

/ /
Flags:
Test Text
Cheat Sheet ▼

Highlighted Matches

Match Details

Regex Cheat Sheet

.Any character (except newline)
\dDigit (0-9)
\DNot a digit
\wWord character (a-z, A-Z, 0-9, _)
\WNot a word character
\sWhitespace (space, tab, newline)
\SNot whitespace
\bWord boundary
^Start of string/line
$End of string/line
[abc]Character class (a, b, or c)
[^abc]Not a, b, or c
[a-z]Range (a to z)
*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n times
{n,m}Between n and m times
(abc)Capture group
(?:abc)Non-capturing group
a|ba or b (alternation)
(?=abc)Lookahead
(?!abc)Negative lookahead
(?<=abc)Lookbehind

How It Works

This regex tester processes everything in your browser using JavaScript's native RegExp engine — no data is sent to any server. Enter a pattern and test text, and see matches highlighted in real time.

Real-Time Matching

As you type your regex pattern or test text, the tool instantly finds all matches, highlights them in the text, and shows detailed match information including positions and capture groups. No button click needed.

Capture Groups

If your regex contains parentheses (), the tool shows each capture group's value. For example, (\d{3})-(\d{4}) matching "555-1234" shows Group 1 = "555", Group 2 = "1234". This is essential for extracting parts of matched text.

Flags

g (global) finds all matches. i (case-insensitive) ignores case. m (multiline) makes ^ and $ match line boundaries. s (dotAll) makes . match newlines too.

Privacy First

All processing runs locally in your browser using JavaScript. Your data never leaves your device — there are no server requests, no cookies, and no tracking.

Frequently Asked Questions (FAQ)

Q: What is a regular expression?

A: A regular expression (regex) is a pattern used to match character combinations in text. It is used in programming, text editors, and command-line tools for searching, validating, and replacing text.

Q: Is my data stored on the server?

A: No. All matching happens directly in your browser using JavaScript's native RegExp engine.

Q: What regex flags are supported?

A: g (global), i (case-insensitive), m (multiline), and s (dotAll).

Q: What are capture groups?

A: Parts of regex in parentheses () that capture matched text. The tool shows all groups for each match.

Q: Does matching happen in real time?

A: Yes. Results update instantly as you type — no button click needed.

Q: What regex flavor does this tool use?

A: JavaScript's native RegExp engine, supporting character classes, quantifiers, anchors, lookaheads, lookbehinds, and capture groups.

Q: Can I use preset patterns?

A: Yes. Click any preset button (Email, URL, IP, Phone, Date, HTML Tag, Hex Color) to load it instantly.

Q: Is this tool free?

A: Yes, completely free with no registration required.