REGULAR EXPRESSION TESTER
Test and understand regular expressions
Build and debug regex patterns while matches are highlighted in your test text. Inspect numbered and named capture groups, preview replacements, and review common syntax.
JavaScript RegExp runs in your browser. Optional PHP PCRE sends only the current pattern and sample text to this site for testing; it is not saved.
01 / REGEX TESTER
Pattern, flags, and test text
Runs locally in a Web Worker. A time limit keeps a slow pattern from freezing the page.
Global matching is used for the result list. The g flag controls whether replacement changes one match or all matches.
Templates are practical starting points, not complete validators for every standard or edge case.
Matches
0
Enter a pattern to start testing.
Replacement preview
Replacement preview
Supports $0, $1, $2, $&, $$, ${name}, and $<name>. $0 and $& insert the full match. In either engine, the g flag controls whether one match or all matches are replaced.
Regex explainer
Regex explainer
A best-effort description of common regular-expression syntax.
Enter a pattern to see its syntax breakdown.
Capture group inspector
Capture group inspector
| Match # | Group | Name | Captured value | Index |
|---|
This pattern has no capture groups.
ABOUT THIS TOOL
Regex Sandbox features
Create and debug regular expressions for JavaScript or PHP without external services. The tool handles Cyrillic and English text and shows matches directly in the sample.
- Live highlighting of matches in Russian, English, and mixed text.
- Capture group table with group numbers, names, matched text, and positions.
- Substitution preview with numbered and named references.
- Plain-language explanation for common anchors, groups, escapes, character classes, and quantifiers.
- One-click starter patterns for email, URLs, dates, phones, IP addresses, UUIDs, password rules, and HTML tags.
- No external libraries or services. JavaScript mode stays in your browser; PHP PCRE sends only the current test request to this site and stores no text.