Skip to main content

Regex Tester

Test regular expressions in real time. See highlighted matches, capture groups, and match details instantly.

//g

Features

A powerful regex testing environment with instant feedback.

Real-Time Matching

See matches highlighted instantly as you type your pattern and test string. No button clicks needed.

Capture Group Details

Named and numbered capture groups are extracted and displayed for each match with their values.

Quick Patterns

Choose from common regex patterns like email, URL, phone number, IP address, and date formats.

Real-Time Feedback

Every keystroke updates matches and groups instantly. No submit button needed.

How It Works

Three simple steps to test any regular expression.

1

Enter a Pattern

Type your regular expression in the pattern field. Select flags like global, case-insensitive, multiline, or dotAll as needed.

2

Provide Test Text

Paste or type the text you want to test against. Matches are highlighted in real time as you type.

3

Review Results

See the match count, highlighted matches in context, and detailed info for each match including index and capture groups.

Related Tools

More developer utilities for working with text and data.

Frequently Asked Questions

Common questions about regular expressions and this tool.

This tool uses JavaScript's built-in RegExp engine, which supports standard regex syntax including character classes (\d, \w, \s), quantifiers (+, *, ?, {n,m}), anchors (^, $, \b), groups and backreferences, lookahead/lookbehind assertions, and Unicode property escapes. The available flags are g (global), i (case-insensitive), m (multiline), and s (dotAll).

Capture groups are portions of a regex pattern enclosed in parentheses. They let you extract specific parts of a match. Use (pattern) for numbered groups or (?<name>pattern) for named groups. This tool displays all captured group values for every match, making it easy to verify your extraction logic.

The global flag tells the regex engine to find all matches in the text, not just the first one. Without it, only the first match is returned. The case-insensitive (i) flag makes the match case-insensitive, multiline (m) makes ^ and $ match line boundaries, and dotAll (s) makes . match newline characters.

Different programming languages have slightly different regex engines. JavaScript (used by this tool) may differ from Python, Java, or PCRE in features like lookbehind support, Unicode handling, and escape sequences. Always verify your regex in the target language. That said, the core syntax is the same across most languages.