Developer tools · Regex
Regex Tester
Test JavaScript regular expressions against any string. See all matches, capture groups, and positions — with flags g, i, m and instant feedback. Free regex tester online.
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
- 1Enter your regular expression pattern (without the surrounding slashes).
- 2Select flags: 'g' to find all matches, 'i' for case-insensitivity, 'm' for multiline mode.
- 3Enter the test string to match against.
- 4The 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
- pattern:
- (\w+)@(\w+\.\w+)
- flags:
- g
- testString:
- hello@example.com and bob@test.org
Result
- summary:
- 2 match(es) found
Match digits
Inputs
- pattern:
- \d+
- flags:
- g
- testString:
- Order 123, item 456, qty 7
Result
- summary:
- 3 match(es) found
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.