Hi!
I'm very new to Regular Expressions, but I thought it'd be the best way to validate email addresses entered on my form.
My Regex works, except if the email address entered has an underscore character (_
) in it.
Because of my lack of experience with regular expressions, I'm not sure where in my pattern I'm supposed to add the offending character to allow it:
Dim pattern As String = "^[-a-zAZ0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-0]+(\.[-.a-zA-Z0-0+)*\." & _
"(com|edu|info|gov|int|mil|net|org|biz|name|museum|coop|aero|pro|tv|[a-zA-Z]{2})$"
Another guy on DreamInCode had the same problem. He said he fixed it by adding the _
after the numeric check.
I see the A-Z0-9, but I'm not sure which is the numeric check... I haven't worked much in Regex so I hope nobody minds pointing out where to add the _
Thanks in advance