Regex tester
Enter a pattern and test string to instantly see all matches highlighted, with capture groups listed below.
About this tool
Test regular expressions live with match highlighting, capture groups, and all JavaScript flags. Paste your pattern and test string — instant results.
Enter a pattern and test string to instantly see all matches highlighted, with capture groups listed below.
- 1
Enter your regular expression pattern in the pattern field (without slashes).
- 2
Set any flags you need: g for global, i for case-insensitive, m for multiline.
- 3
Paste your test string below — all matches are highlighted in real time.
- 4
Hover a match to see the captured groups.
Test and debug regular expressions before adding them to your codebase.
Verify that a pattern matches the exact strings you expect without edge cases.
Inspect capture groups to confirm your regex extracts the right substrings.
Match all numbers
Pattern: \d+ | Text: Order 123 and item 456Matches: 123, 456Match email address
Pattern: [\w.+]+@[\w.]+\.[a-z]{2,} | Text: contact@example.comMatch: contact@example.comMatch words starting with capital
Pattern: \b[A-Z]\w* | Text: Alice and Bob went to LondonMatches: Alice, Bob, LondonThese answers explain common regex tester tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.
Which regex flavour does this tool use?
This tool uses JavaScript's built-in RegExp engine, which follows the ECMAScript standard. It supports all standard flags: g (global), i (case-insensitive), m (multiline), and s (dotAll).
What are capture groups?
Capture groups are parts of a regex wrapped in parentheses. They let you extract specific substrings from a match. This tool lists each group's value for every match found.
Why does my pattern match nothing?
Common causes include forgetting to escape special characters like . or *, using anchors (^ or $) without the multiline flag, or a pattern that is more specific than the test string.
What regex flags does this tool support?
The tester supports the standard JavaScript regex flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line starts and ends), and s (dotAll — dot matches newline characters). You can combine flags as needed.
How do I test a regex for email or URL validation?
Paste your regex pattern in the pattern field, then paste sample email addresses or URLs in the test string field. The tool highlights every match so you can immediately see which inputs pass and which do not, without running code.