Regular Expression Help

L

Lav KG

Hi all,

Please help me convert the following expression to a valid Regex.

[a-zA-Z]{1}[0-9a-zA-Z\.\-]{0-63}@[0-9a-zA-Z]{1-64}.[a-zA-Z]{2,3}

I'm trying to validate an email address by a
RegularExpressionValidator.


Thanks in advance
Lav KG
 
K

Kevin Spencer

The rules for SMTP email addresses are quite complex, and there are very few
regular expressions that can cover all of them. However, here is one we
created that covers almost all of them:

(?i)([-.\w]+)\@(?:((?:\d{1,3}\.){3}\d{1,3})|([-a-z0-9]+(?:\.[-a-z0-9]+)*)\.((?:com|edu|gov|int|mil|net|org|biz|info|name|museum|coop|aero|[a-z]{2})))

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top