Regex Tester
Test JavaScript regular expressions against sample text with match groups
About this calculator
The Regex Tester runs JavaScript regular expressions against sample text and lists every match with its index and capture groups. The g flag is added automatically so all matches are enumerated, an optional replacement string previews text.replace() output with $1-style references, and invalid patterns surface the RegExp constructor's own error message. Pattern and text sizes are capped (1,000 and 10,000 characters) to guard against catastrophic backtracking freezing the page.
How to use the Regex Tester tool
- Enter or paste your input into the field.
- Read the output — it updates instantly as you type.
- Adjust the options, if any, to fit your use case.
- Copy the page URL to share the exact result.
Common examples
- \d+ against "Order 66 shipped in 3 days" → 2 matches: "66" at 6, "3" at 20
- (\w+)@(\w+)\.com on "contact: [email protected]" → match with groups ["ada", "example"]
- cat with flag i, replace "dog" → "dog sat on the dog mat" (2 case-insensitive matches)
Frequently asked questions
How does the Regex Tester tool work?
Enter or paste your input and the tool processes it directly in your browser, showing the result immediately. Nothing you type is uploaded to a server — the entire computation happens on your device.
When would I use the Regex Tester tool?
It is handy for development, debugging, design and administration tasks — whenever you need this transformation or check done quickly without installing anything or trusting a third-party service with your data.
How reliable are the results?
The tool implements the relevant standard or specification directly, so its output matches what compliant software produces. Edge cases such as empty or malformed input are reported clearly instead of failing silently.
Can I share a specific result with someone else?
Yes. Your input updates the URL, so copying the address bar and sharing the link reopens the tool in the same state for whoever clicks it.