Email Address
Matches common addresses such as [email protected]. It is a practical filter, not a full RFC 5322 check: it accepts some invalid addresses ([email protected]) and rejects letters outside A–Z (jö[email protected]).
Six patterns for common inputs. Each one was run in JavaScript and Python against inputs that should and
should not match, and the note under it says what it accepts and what it rejects. Open any of them in the
tester to try your own text. In Python, use re.fullmatch (with $ a trailing
newline still passes) and the re.ASCII flag (without it, \d also matches digits
from other scripts).
Matches common addresses such as [email protected]. It is a practical filter, not a full RFC 5322 check: it accepts some invalid addresses ([email protected]) and rejects letters outside A–Z (jö[email protected]).
Matches http:// and https:// addresses with a domain or IPv4 host and an optional path or query. It rejects localhost, other schemes such as ftp://, spaces and paths with characters such as , ; ! * ' or $, and it accepts out-of-range IPs such as 999.999.999.999.
Requires at least 8 characters with a lowercase letter, an uppercase letter, a digit and one of @$!%*?&. Any other symbol, such as # or a space, makes it fail, so widen the last character class if your rules allow them.
Checks four numbers from 0 to 255 separated by dots. It also accepts leading zeros such as 01.02.03.004.
Matches the YYYY-MM-DD shape with months 01–12 and days 01–31. It does not check how many days each month has, so 2026-02-31 passes: validate the real date in code.
Matches 3- or 6-digit hex colors, with or without the leading #. Colors with an alpha channel (#RRGGBBAA) do not match.
The official RFC 5322 standard for email addresses is extremely permissive, allowing many obscure formats. For most applications, a simplified regex that checks for a string, an @ symbol, and a domain is preferred.
No. Regular expressions are not designed to parse nested structures like HTML or XML. It's highly recommended to use a dedicated HTML parser instead.