I have a regular expression checker for emails in .NET 2.0 that uses client-side validation (javascript).
Current expression: "\ w + ([- +. '] \ W +) @ \ w + ([-.] \ W +). \ W + ([-.] \ W +)", which works for my needs (or so I thought).
However, I had a problem with apostrophes, as I had a copy / paste of the email address from Outlook in the form text field
Chris.OBrian@somerandomdomain.com
You can see that the apostrophe is another character from what happens if I just typed a text box
'vs - but both are apostrophes
Ok, I thought, just add this character to the check string to get
"\ W + ([-. + '] \ W +) @ \ W + ([-.] \ W +) \ W + ([-.] \ W +)."
I will copy the βspecialβ apostrophe into the validation expression, then I type in the email address and use the same clipboard element to paste the apostrophe, but the validation is still pending.
The apostrophe is not like the .net code behind the file in the form of a .net form, and since verification is not yet done, I assume that it is considered a different character due to some kind of .cs encoding of the source file?
Is this plausible, has someone else encountered the same problem?
thanks
Chris source share