Saved
Developer tools·Regex

Regex Tester

Test regular expressions against sample text with highlighted matches and capture groups. Fully client-side — no account, uploads, or remote storage.

Added Apr 29, 2026

Quick examples

Input

Result

Enter a value for regular expression to see your result.

How it works

Tests a JavaScript regular expression against a test string and shows all matches, capture groups, and match positions. Uses the JavaScript RegExp engine with standard ECMAScript flags.

Step by step

  1. 01Enter your regular expression pattern (without the surrounding slashes).
  2. 02Select flags: 'g' to find all matches, 'i' for case-insensitivity, 'm' for multiline mode.
  3. 03Enter the test string to match against.
  4. 04The tool evaluates the pattern and shows match count, matched text, positions, and capture groups.

Examples

Match email addresses

The pattern captures username and domain in two groups.

Inputs

Regular expression:
(\w+)@(\w+\.\w+)
Flags:
g
Test string:
hello@example.com and bob@test.org

Result

Result:
2 matches found

Match digits

Inputs

Regular expression:
\d+
Flags:
g
Test string:
Order 123, item 456, qty 7

Result

Result:
3 matches found
Note: Backslashes must be entered as double backslashes (\\d for \d) in some contexts, but in this tool enter them as-is (\d).

Frequently asked questions

What regex engine does this use?

This tester uses the JavaScript (ECMAScript) regex engine built into your browser. It supports standard features including groups, lookaheads, named captures, and character classes.

What does the 'g' flag do?

The 'g' (global) flag makes the regex find all matches in the string, not just the first one. Without 'g', the engine stops after the first match.