Regex Tester
Write a regular expression, choose flags, test it against sample text, inspect matches and capture groups, and preview replacements.
Inputs
Results
- Matches
- 2
- Status
- OK
- hello@example.comIndex 8 · 0 capture group(s)
- support@example.orgIndex 29 · 0 capture group(s)
Matches update as you edit the pattern, flags, or text.
How it works
Enter your input
Fill in the values, paste your text, or upload the file this tool works with.
See results instantly
Most tools update live as you type; a few use a single button. Either way, the result appears right on this page.
Use your results
Copy, download, or share what the tool produces — you're always in control of the output.
What is Regex Tester?
Test a JavaScript regular expression against real text, inspect matches and capture groups, and preview replacement output.
How to test a regular expression
How to use it
- Enter the regex pattern without surrounding slashes.
- Add flags such as g, i, or m when needed.
- Paste the text you want to test.
- Review the match count, match positions, capture groups, and replacement preview.
Useful checks
Regex testers are useful for validating form patterns, cleaning log data, preparing search-and-replace rules, and debugging capture groups before they go into code.
Debugging tips
- Start with a small sample before testing a long document.
- Add the g flag when you want all matches.
- Use capture groups to confirm which part of the match you will reuse.
RegExp notes
The tester uses JavaScript RegExp behavior. Patterns written for PCRE, .NET, Java, or database engines may need adjustment before they match the same way.
Frequently Asked Questions
Which regex flavor does this use?
It uses JavaScript regular expressions, the same flavor used by modern browsers.
Why does a valid regex from another language fail?
Regex syntax differs between engines. A pattern from PCRE, Python, or Java may need small changes for JavaScript.
Does it limit matches?
Yes. The preview stops after 200 matches so a runaway pattern does not overwhelm the page.
Why are matches capped?
The tester lists up to 200 matches so an accidental broad pattern does not freeze the page.
Related Tools
- PopularAvailableLocal
UUID Generator
Generate standards-compliant UUID v4 and GUID identifiers individually or in bulk.
- PopularAvailableLocal
JSON, YAML & XML Formatter
Format, minify, and validate JSON and XML, and convert between JSON and YAML.
- PopularAvailableLocal
QR Code Generator & Reader
Create QR codes and read QR images locally.
- PopularAvailableLocal
Base64 Encoder/Decoder
Encode and decode text using Base64 locally.
- PopularAvailableLocal
URL Encoder/Decoder
Encode and decode URLs in separate tabs, with batch and recursive options.
- PopularAvailableLocal
Unix Timestamp Converter
Convert Unix timestamps (seconds and milliseconds) to dates and vice versa.
- AvailableLocal
HTML Entity Encoder/Decoder
Encode and decode HTML entities safely.
- AvailableLocal
JWT Decoder
Decode JWT header and payload locally.
- AvailableLocal
Cron Expression Generator & Validator
Build, validate, and decode 5-field cron expressions with next run times.
- AvailableLocal
JSON Diff Checker
Compare two JSON values and list changed paths.