Other Resources:
Email address @ sign validation
According to the Internet specification RFC 2822, an email address must have a single "@" sign. For example, john@host.net is a valid email address.
There should be at least one character before the "@" sign, but the total number of characters before the "@" sign should not be more than 64.
There should be at least one character after the "@" sign, but the total number of characters after the "@" sign should not be more than 255.
How to write a single regular expression to validate all rules listed above?
✍: FYIcenter.com
Here is the regular expression for email address @ sign validation:
^[^@]{1,64}@[^@]{1,255}$
^ - begin of the string
[^@] - any character other than @
{1,64} - repeating 1 or up to 64 times
@ - match @ itself
[^@] - any character other than @
{1,255} - repeating 1 or up to 255 times
$ - end of the string
2016-06-23, 4144👍, 0💬
Popular Posts:
How to capture the Soso Spider entries from Web log file? Here are some Web log file entries:127.0.0...
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an exa...
All credit card numbers issued by MasterCard must start with 51 through 55 and have 16 digits. For e...
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an exa...
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an exa...