email address verification
How to verify email address ? While submitting form.
How to verify email address ? While submitting form.
you would do some Regex on it, regular expressions, checking the field of the email address. If Regex returns true then email address is valid so continue, otherwise its false and there is an error so notify the user.
Regex theEmailValidator = new Regex(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3} \.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)"); //"(?<user>[^@]+)@(?<host>.+)"); Match emailMatch = theEmailValidator.Match(EmailAddressHere); |
There are a few Regex patterns, this one is what I use and works well
Well, you have any another way, that's probably more neat & visual.
if you are working with Visual Web Developer, Use Reguler Expression Validation control, drag it next to the email text box, in its properties "ExpressiontoValidate" select "Internet Email Address" & in property "ControltoValidate" select name of the textbox which you use for email input. In its Error property write any message you want to display in case of Wrong email entery, this will work when user will hit "Submit" button on your webform.
Thx for your reply.
What i'm looking is -