// free ยท runs in your browser ยท nothing uploaded
Practical Regex Patterns: Email, Phone, URL and Date, With What They Match
Four ready JavaScript regex patterns, an example each one matches, and where each one is too simple.
๐ Official sources: MDN regular expressions
We build every tool from the official rules and re-check them when they change. Always confirm with the official source before you rely on a result.
๐ ๏ธ Spotted a mistake or an out-of-date rule? Tell us
Four patterns
| Finds | Pattern | Matches | Watch out |
|---|---|---|---|
[\w.+-]+@[\w-]+\.[\w.]+ | [email protected] | Not a full RFC 5322 check; confirm by sending an email | |
| Phone | \+?\d[\d\s-]{7,}\d | +44 20 7946 0958 | Doesn't check country rules; use libphonenumber for that |
| URL | https?://[^\s]+ | https://example.com/a?b=1 | Keeps a trailing full stop or bracket |
| Date | (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) | 2026-10-13 | Accepts 2026-02-31; check the date itself after matching |
All four use the JavaScript flavour with the g flag to find every match. Open any of them in the tester above to see the matches highlighted and adapt the pattern.
Related tools
Questions people ask
Which regex flavour does this use?+
JavaScript (ECMAScript), the same engine as Chrome and Node.js. It supports named groups (?<name>โฆ), lookbehind, Unicode property escapes with the u flag, and the s (dotAll) flag.
What do the flags mean?+
g finds every match instead of the first, i ignores upper/lower case, m makes ^ and $ match at each line, s lets . match line breaks, and u turns on full Unicode support.
Why was my pattern stopped?+
Some patterns, such as nested quantifiers like (a+)+, can take exponential time on certain text (catastrophic backtracking). The tester runs each pattern in a separate worker and stops it after 1.5 seconds so your page never freezes.
How do I use groups in the replacement?+
Use $1, $2 โฆ for numbered groups, $<name> for named groups and $& for the whole match.