What is a regular expression?
A regular expression (regex) is a compact pattern language for searching and validating text — emails, UUIDs, URLs, log lines, and more. Developers use them in forms, parsers, linters, and security filters.
This workbench lets you edit a pattern with flags (g/i/m/s/u), highlight matches and capture groups against a test string, read a plain-English breakdown of the pattern, insert common presets, and export snippets for multiple languages. Matching runs in a Web Worker with a timeout to reduce ReDoS risk.
How to use this tool
- Pick a preset (Email, UUID, IPv4, …) or paste your own pattern and toggle flags.
- Enter a test string and inspect color-coded matches plus the groups table.
- Open Explainer for a token-by-token English breakdown, Builder to generate a class-based pattern, or Export to copy JS/Python/Go/Java/PHP/Rust snippets.
Frequently asked questions
Is my regex or test data sent to a server?
No. Pattern parsing, explanation, and matching all run in your browser. Nothing is uploaded.
How do you mitigate ReDoS?
Matches execute in a Web Worker with a short timeout. Pathological patterns that hang are aborted with a timeout message instead of freezing the UI.
Is the explainer a full ECMAScript parser?
It covers common constructs (groups, classes, quantifiers, anchors, escapes, alternation) for learning and debugging. Exotic or vendor-specific syntax may be summarized approximately — always trust the JS engine for exact behavior.