I am using C# with jQuery to validate a bunch of emails entered into a form.
public const string Email = "^([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})$";
This is what I’m using but I seem to be getting wrong entries ? Can anyone assist me ?
Thanks
It looks like you’re double-escaping your backslashes. It’s helpful to use the
@syntax for string declaration to avoid this confusion:You’ll be closer without the double-escape:
The
\[after the matched@is probably also a mistake, leaving…