Skip to content

Regex Tester

Test a regular expression against sample text with live match highlighting and capture group inspection.

Category: development
Use Case: Building and Debugging a Regex Pattern, Extracting Capture Groups from Text, Verifying a Pattern Matches Expected Input
Privacy: 100% browser-based
//g

Highlighted result

Contact us at hello@example.com or support@example.org for help.

2 matches

Match 1: hello@example.com (at index 14)

Groups: $1=hello, $2=example.com

Match 2: support@example.org (at index 35)

Groups: $1=support, $2=example.org

Recommended Settings

Pro Tips

  • Enable Global to find every match in the text, not just the first one - most real-world use cases want this on
  • Capture groups (in parentheses) are numbered $1, $2, and so on in the order they appear, and shown separately for each match
  • Named groups, written as (?<name>...), are also detected and shown by name for easier reference in your code
  • An invalid pattern shows JavaScript's own regex error message, which usually points to exactly what's malformed

Most Popular

Most developers test with Global and Ignore Case enabled to find every match regardless of letter casing

When to Use This Tool

Building and Debugging a Regex Pattern

Iteratively refine a regular expression while seeing live match results.

Extracting Capture Groups from Text

See exactly what each capture group extracts from matched text.

Verifying a Pattern Matches Expected Input

Confirm a validation pattern correctly matches valid input and rejects invalid input.

Learning Regular Expression Syntax

Experiment with regex syntax and see immediate visual feedback on matches.

How It Works

1

Compile your pattern and selected flags into a JavaScript regular expression

2

Run it against your test string, collecting every match along with its capture groups

3

Highlight each matched substring directly within the test text for immediate visual feedback

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Client-side JavaScript RegExp engine for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

What's the difference between the g and no-g flags?

With the Global flag, the regex finds every match in the text. Without it, only the first match is found, even if the pattern could match multiple times.

What are named capture groups?

Groups written as (?<name>...) let you reference a captured value by name instead of by position, making patterns with many groups easier to read and use in code.

Does this support all JavaScript regex features?

Yes, since it runs your pattern through the browser's actual native RegExp engine, all standard JavaScript regex features and flags are supported.

Is my test data sent anywhere?

No. All pattern matching happens locally in your browser.