Regex Tester
Build and debug regular expressions with instant feedback. Type a pattern and test string to see every match highlighted, capture and named groups in a table, flags you can toggle, a find-and-replace preview, a library of proven patterns and ready-to-paste JavaScript.
Enter the pattern (without slashes), toggle flags (g, i, m, s, u, y) and paste your test text. Matches highlight as you type, with index and groups listed below; syntax errors are explained. Add a replacement using $1 or $<name> to preview replace results. Slow patterns that risk catastrophic backtracking are flagged.
2 matches
0.1 msContact [email protected] or [email protected]. Not an email: carol@localhost
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | [email protected] | 8 | $1: alice, $2: example |
| 2 | [email protected] | 29 | $1: bob, $2: test |
Replace
Common patterns
Use it in JavaScript
const re = /(\w+)@(\w+)\.com/g;
const matches = [...text.matchAll(re)];Zero Server Uploads
Files process in local RAM
Instant WASM Speed
No waiting queues or lags
Unlimited Batching
Convert files without limits
Suggest a Feature or Improvement for Regex Tester
Need custom options, higher limits, or extra format support? Let our engineering team know!
How to use Regex Tester
- 1Type your regular expression.
- 2Toggle the flags you need.
- 3Paste test text and review matches and groups.
- 4Try a replacement, then copy the code.
Regex essentials
\d digit, \w word character, \s whitespace, . any character; * zero or more, + one or more, ? optional, {2,5} a range; ^ and $ anchor the start and end (per line with the m flag); (…) captures, (?:…) groups without capturing, (?<name>…) names a group; (?=…) and (?<=…) are lookarounds.
Nested quantifiers like (a+)+ can take exponential time on crafted input (ReDoS). Keep patterns specific.
Flavours
This tester uses JavaScript's engine. Python, PCRE (PHP), Java and .NET behave the same for most everyday patterns, but differ in lookbehind rules, named-group syntax and some escapes. Describe what you want in plain English with the Regex Generator.
Frequently Asked Questions
Why does my regex match nothing?
Check escaping (a literal dot needs \.), anchors with multi-line text (enable m), and case (enable i).
Is my code or data uploaded?
No. Everything runs in your browser; nothing you paste is sent to a server or stored.
Related Tools
Regex Generator
Describe what you want to match in plain English and get a tested regular expression.
JSON Validator
Validate JSON with exact error line and column, auto-fix common mistakes, and format it.
Cron Expression Generator
Build and explain cron expressions, and see the next run times in your time zone or UTC.