Regex Tester
Regex Tester
Test patterns and inspect match locations. Use this online tool instantly.
Input
Matches
About The Regex Tester
This free online Regex Tester runs JavaScript regular expressions against sample text in your browser. It is useful for checking extraction patterns, log filters, validation rules, capture groups, and named groups before using a pattern in code.
The result lists each match with its index, length, full matched text, numbered capture groups, and named capture groups when the pattern uses them. Invalid patterns or invalid flags are reported without keeping stale output.
How to Test Regex Online
- Enter a regular expression in Pattern without wrapping slashes.
- Enter JavaScript regex flags such as g, i, or m.
- Paste realistic sample text into Text.
- Click Run Regex to inspect matches and capture groups.
- Use Load sample to test a realistic support-ticket snippet.
Choosing Options Correctly
Flags:
- Use g to return every match instead of the first match only.
- Add i for case-insensitive matching.
- Add m when ^ and $ should work per line.
Common Use Cases
- Extract order IDs, ticket IDs, dates, emails, or error codes from copied text.
- Check capture groups before using a regex in JavaScript.
- Debug why a validation pattern matches too much or too little.
- Test log-search patterns against a small sanitized sample.
Quick FAQ
Is my test text uploaded?
No. Regex testing is designed to run in the browser.
Should I include slashes around the pattern?
Usually enter the pattern itself and set flags separately unless the tool explicitly supports slash notation.
Why do results differ from another programming language?
Regex syntax and features differ between JavaScript, Python, PCRE, Java, and other engines.
What should I avoid pasting?
Avoid secrets, tokens, production logs, or personal data when testing patterns.
Related Tools
Regex Explainer
Explain regex tokens, test match behavior, and understand pattern logic directly in your browser.
Text Redactor
Redact sensitive data like email, phone, IP, and URLs.
Unicode Inspector
Inspect code points, bytes, and character metrics in text.
Text Case Converter
Switch between upper, lower, title, sentence, snake, camel, and more.