About this tool
What is a regular expression?
A regular expression is a pattern language for matching, validating and transforming text — from email validation to log parsing. This tester evaluates JavaScript-style patterns live and shows match groups, so you can see exactly what each part of the pattern captures.
How to use it
- Type your pattern and paste sample text; matches highlight instantly.
- Inspect numbered capture groups to verify each sub-pattern.
- Toggle flags such as global, case-insensitive and multiline.
Examples
- Validating an email shape:
^[^\s@]+@[^\s@]+\.[^\s@]+$(syntax only — deliverability needs a mailbox check). - Extracting dates:
\b(\d{4})-(\d{2})-(\d{2})\bcaptures year, month and day separately. - Redacting card-like numbers before logging.
Important limitations
- Regex validates shape, not meaning: a “valid” email pattern still accepts nonexistent addresses.
- Nested or recursive structures (HTML, JSON) are poor regex targets — use a real parser.
- Catastrophic backtracking: patterns like
(a+)+$can hang on long inputs; keep quantifiers specific.
Privacy
Matching runs in your browser. Test strings often contain production data — it never leaves this page.
Frequently asked questions
Why does my pattern match too much?
Usually greedy quantifiers (.*). Make them lazy (.*?) or anchor with ^ and $.
Which flavor is supported?
JavaScript (ECMAScript) regex as implemented by your browser. PCRE-only features like recursion are unavailable.
How do I match a literal dot or bracket?
Escape them: \., \[. Unescaped, they are wildcards and classes.