Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Email address: RFC 2822
- This regular expression implements the official RFC 2822 standard for email addresses. Using this regular expression in actual applications is NOT recommended. It is shown to illustrate that with regular expressions there's always a trade-off between what's exact and what's practical.
- (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
- sample results
- maches
- rich@[192.168.1.10]
- FirstName@somehost.com
- FirstName@[192.168.1.10]
- brian@foo.bar
- noMatch
- "First Name"@somehost.com
- "Firsr Name"@[192.168.1.10]
- ---------
- Email address: RFC 2822 (simplified)
- Matches a normal email address. Does not check the top-level domain.
- Requires the "case insensitive" option to be ON.
- [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
- sample resutls
- maches
- FirstName@somehost.com
- brian@foo.bar
- noMatch
- "First Name"@somehost.com
- "Firsr Name"@[192.168.1.10]
- rich@[192.168.1.10]
- FirstName@[192.168.1.10]
- ---------
- or... just not empty?
Add Comment
Please, Sign In to add comment