About the Regex Tester
Write a pattern, paste some text, and see exactly what matches. Capture groups are listed for each match along with their position, which is usually what you need when a pattern almost works but not quite. Everything runs in your browser using the same engine your JavaScript will use.
Also known as: regular expression tester, regex match tester, test regex, regexp checker, pattern matcher.
How to use this calculator
- Enter pattern, test text, global (find all matches), ignore case and the other fields.
- The result updates instantly as you type — press Calculate (or Enter) at any time.
- Review the breakdown shown under the main result.
- Use Copy result or Share to save the answer or send a link with your inputs.
Formula
Worked example
Using the values pre-filled in the calculator above:
- Pattern: (\w+)@(\w+)\.com
- Test text: Contact alice@example.com or bob@test.com today.
- Global (find all matches): yes
- Ignore case: no
- Multiline (^ and $ match each line): no
the calculator returns:
- Matches found: 2
- Pattern: /(\w+)@(\w+)\.com/g
- Capture groups: 2
- First match: alice@example.com
Tips & common mistakes
- Escape a literal dot as \. — an unescaped dot matches any character.
- Use \d for digits, \w for word characters and \s for whitespace.