Regex Tester
Find patterns in text, replace matching content or extract useful information such as email addresses, URLs and numbers. Explore regular expressions with live highlighting, explanations and built-in examples, or validate your patterns against dedicated test cases.
Loading workspace…
Run a match to see the result.
| Test input | Expected | Actual | Status | |
|---|---|---|---|---|
| — | Not run | |||
| — | Not run | |||
| — | Not run |
How to use
- Enter a regular expression: Write your own pattern or start with a built-in example to explore common matching rules.
- Add test text: Paste, edit or import a local text file to see highlighted matches and corresponding results.
- Choose an operation: Find matches, replace text, extract content or run test cases. Adjust matching options as needed.
- Review and save results: Inspect matches, capture groups and pattern explanations, then copy results or download replacement and extraction files.
Support and limitations
- Uses the browser's native JavaScript RegExp engine, including ordinary and named capture groups, assertions, backreferences and supported flags. Syntax and behavior may differ from other regex engines.
- Supports live matching, string replacement, text extraction and test cases. Replacement results can be downloaded as TXT, while extraction supports TXT, JSON and CSV.
- Patterns, test text and replacement expressions support up to 16 Ki, 2 Mi and 64 Ki UTF-16 code units respectively. Local UTF-8 file imports are limited to 8 MiB and must also fit the decoded text budget.
- Retains up to 10,000 match records, subject to cumulative capture data and scanning budgets. Replacement and extraction outputs are limited to 16 Mi UTF-16 code units. Partial or over-budget results are clearly indicated.
- Includes pattern explanations, structural diagrams and syntax references. Complex patterns may exceed explanation or diagram budgets. Diagrams illustrate syntax structure rather than the engine's actual execution path.
- Regular expressions run in a separate Worker with a default execution deadline of 1.5 seconds. Timed-out tasks are terminated. All text is processed locally in your browser without uploads or persistent storage by the site.
Frequently asked questions
What can regular expressions be used for?
Regular expressions find text that follows a particular pattern. Common uses include finding numbers, extracting email addresses and URLs, identifying log fields, removing extra spaces and replacing text.
Can I use this tool without knowing regular expressions?
Yes. Start with a built-in example and observe the highlighted matches and results. Brief explanations, structural diagrams and syntax references help you understand and modify patterns.
Can I extract email addresses, URLs or other content from text?
Yes. Choose Extract mode and enter a suitable pattern to extract complete matches or selected capture groups. The tool supports deduplication, custom text separators and TXT, JSON or CSV exports.
Why do some regular expressions time out?
Complex patterns can require extensive backtracking. The tool uses a separate Worker and an execution deadline to terminate timed-out tasks. Try simplifying the pattern, shortening the input or adjusting the execution settings.