Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the local part of an e-mail address have a minimum length requirement?

Tags:

regex

vb.net

I am using this expression to validate e-mail addresses:

"^[_a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$"

I noticed that in order for the e-mail address to validate, I need to put in at least 3 characters before the @ symbol. Is this a requirement? What if I just want to have an e-mail address with 1 or 2 characters before the @ symbol?

like image 500
Xaisoft Avatar asked Jul 19 '11 17:07

Xaisoft


1 Answers

It is entirely possible to have an e-mail address with just one character. All of the guidelines are defined in RFC822: http://www.ietf.org/rfc/rfc0822.txt?number=822

The necessary REGEX: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html

like image 61
Brad Avatar answered Oct 19 '22 15:10

Brad