Free Online Regex Tester
Test and debug regular expressions in your browser. As you type, every match is highlighted in the test string, every capture and named group is broken out in a table, and a token-by-token breakdown explains what each piece of the pattern does. Switch to Replace mode to see live replacement output. The full URL is shareable: a copy-paste of the link round-trips your pattern, flags, and test string. JavaScript / ECMAScript flavor, with copy-paste-ready code for Python, Java, and Go.
| # | Match | Index | Length | Groups |
|---|---|---|---|---|
| 1 | The | 0 | 3 | - |
| 2 | Quick | 4 | 5 | - |
| 3 | Brown | 10 | 5 | - |
| 4 | Fox | 16 | 3 | - |
| 5 | Lazy | 35 | 4 | - |
| 6 | Dog | 40 | 3 | - |
| 7 | Another | 45 | 7 | - |
| 8 | Sample | 53 | 6 | - |
| 9 | Sentence | 60 | 8 | - |
\bword boundary[A-Z]character class[a-z]character class+one or more\bword boundary/\b[A-Z][a-z]+\b/gnew RegExp("\\b[A-Z][a-z]+\\b", "g")re.compile(r"""\b[A-Z][a-z]+\b""", )Pattern.compile("\\b[A-Z][a-z]+\\b")regexp.MustCompile(`\b[A-Z][a-z]+\b`)How to use
- 01Type or paste your regex into the Pattern field. Toggle the flag pills (g, i, m, s, u, y) or type them directly.
- 02Paste the text you want to test into the Test string box. Matches are highlighted live; the count appears above the result.
- 03Open the Matches table to see each match's index, length, and capture groups (numbered and named).
- 04Switch to Replace mode to provide a replacement string. The native engine supports $&, $1, $<name>, and $$ for a literal $.
- 05Use the Common patterns column to one-click a tested regex for email, URL, IPv4, phone, date, UUID, hex color, and others.
- 06The Pattern breakdown shows each token with a plain-English label. Hover any token to see the same hint.
- 07Copy the regex into another language using the export block at the bottom: JS literal, JS RegExp(), Python re.compile, Java Pattern.compile, Go regexp.MustCompile.
- 08Copy the share link button to send a teammate the exact pattern, flags, and test text.
FAQ
What regex flavor does the tool use?▼
JavaScript / ECMAScript. The native browser regex engine runs your pattern, so everything matches exactly what would run in a browser, in Node.js, or in any JS-style regex environment (Edge runtime, Vercel functions, AWS Lambda Node, etc). Behavior differs from PCRE / Python / Java in a few places: JS has no embedded modifiers (?i)/(?m), no possessive quantifiers, and lookbehind support is recent (all modern browsers since 2020).
How do the flag pills work?▼
Click any flag to toggle it. g = global (find every match), i = ignore case, m = multiline (^ and $ match line boundaries), s = dotall (. matches newlines), u = full Unicode, y = sticky (match starting only at lastIndex). Without g or y you get the first match only; the Matches table still shows captures.
How do I use a backreference in Replace mode?▼
In the Replacement field, $1 inserts the first capture group, $2 the second, etc. $& inserts the whole match. $<name> inserts a named group (use a named group like (?<year>\d{4}) in the pattern). $$ inserts a literal $.
Why am I seeing a "ReDoS risk" warning?▼
The tool checks for patterns with nested unbounded quantifiers like (a+)+ or (.*)*. These can backtrack exponentially on adversarial input and lock up the engine for seconds or minutes. If you only run the regex on trusted, short input you can ignore the warning. For user-supplied input, anchor the pattern or rewrite without nested quantifiers.
How does the share link work?▼
Your pattern, flags, test string, and replacement are base64-encoded into the URL hash (#...). Anyone with the link sees the exact same setup when they open the page. Nothing is uploaded; the data lives entirely in the URL.
Why does my pattern work here but fail in Python?▼
JS and Python regex flavors differ in lookbehind support, character class semantics, and a few edge cases. Use the Copy for other languages block to get a Python-style version (re.compile with the right flag constants), then test there.
Can I use named groups?▼
Yes. The syntax is (?<name>...). They show up in the Matches table under the pattern row with the $<name> label. You can reference them in the replacement string as $<name>.
How is this different from regex101 or regexr?▼
Same browser-only execution model. The differences: no signup, the share link is just a URL hash (no server, no analytics), the language export covers JS / Python / Java / Go side by side, and the catastrophic backtracking heuristic warns before you accidentally ship a vulnerable regex. For PCRE / Perl / Ruby flavor support, those external tools have it; this one is JS-first.
Is anything uploaded?▼
No. The pattern, flags, and test string never leave your browser. The share-link URL contains your data base64-encoded, but that lives in your address bar; the page does not send it anywhere.