Regex Tester — Test Regular Expressions Online

regex tester online — live highlighting, no server

This regex tester lets you test regular expressions against any text instantly in your browser. Matches are highlighted in yellow as you type, with position and capture group details in the match list. The common patterns reference includes patterns for email, URL, phone, IP address, and date formats — click any to load it. All matching uses the native JavaScript RegExp engine. Your regex pattern and test data never leave your browser.

Frequently Asked Questions

How do I test a regular expression online?

Paste your pattern into the regex field and your text into the test string area. Matches are highlighted in yellow in real time as you type (debounced 300ms). The match count is shown next to the label, and the match list below shows each match with its start and end index and any named capture groups.

What do regex flags g, i, m, s mean?

g (global) finds all matches in the string — without it only the first match is returned. i (case insensitive) makes letter matching ignore case so "Hello" matches "hello". m (multiline) makes ^ match the start of each line and $ match the end of each line instead of just the whole string. s (dotAll) makes the . metacharacter match newline characters as well as all other characters.

Why is my regex pattern not matching?

Common causes: the g flag is off so only the first match shows; the pattern is anchored with ^ or $ which prevents partial string matches; special characters like . * + ? ( ) [ ] { } \ | ^ $ are not escaped with \; or the i flag is needed for case-insensitive matching. The error message shows JavaScript's native error for invalid patterns. Use the common patterns section for working examples.

Is my regex pattern sent to a server?

No. All regex matching is performed locally using the JavaScript RegExp engine built into your browser. Your pattern and test string are never transmitted to any server. You can verify this by opening DevTools → Network tab while testing — there are zero outbound requests.

What is a capture group in regex?

A capture group is a portion of a regex pattern enclosed in parentheses () that captures the matched text separately from the full match. For example, (\w+)@(\w+) captures the username and domain as separate groups. Named groups use the syntax (?<name>...) — for example (?<year>\d{4})-(?<month>\d{2}) captures a date with named groups "year" and "month" shown in the Groups column of the match list.