Live regex matching with groups, flags and a replace preview
Regex Patterns Library
Grab a regular expression that is already written, explained and tested, instead of writing one from scratch.
Loading tool…
How to use regex patterns library
Search by name or pick a group such as dates, numbers or identifiers.
Read what each pattern accepts and what it deliberately does not check.
Look at its example tests, which run live in your browser.
Copy it as a /regex/ literal or a string, or open it in the regex tester with its tests loaded.
What this tool does
- 36 patterns written for this site, each with strings it must match and strings it must reject.
- Every test runs again whenever the page loads, and the result is shown on each card.
- Paste any value into the test box to see which patterns accept it.
- Each pattern explains its parts and lists the cases it does not cover.
How the result is verified
Every pattern's example tests are run in your browser when the page opens. The summary at the top shows how many of the tests pass right now.
Frequently asked questions
Is there a perfect email regex?
Not a useful one. The full standard allows quoted names and comments that real systems reject. The pattern here accepts what mail providers actually allow; the only real test is to send a message.
Can I use these patterns in Python or PHP?
Most work unchanged. Drop the slashes and flags, pass the flags the way your language expects, and check patterns that use look-behind or Unicode property classes.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Escape special characters so text matches literally in a regex
Pull every match or capture group into a list, deduplicated and sorted
Major, minor, patch, pre-release and build parts, with rule-by-rule errors