I have the following RegEx:
[RegularExpression(@"^[^,']+$|^$", ErrorMessageResourceName = "AlphaNumeric", ErrorMessageResourceType = typeof(Resources.LocalizedStrings))]
This currently allows all characters except a , and a '. However I also need to exclude " but so far have not been able to, as it ends the initial double quote after the @ sign. I've searched Google for help but none of the answers seem to relate to what I'm doing, or seem to work for me.
Can anyone point me in the right direction?
EDIT - Thanks to everyone for their help, using the unicode equivalent worked for me. \u0022 See Anirudh's answer
You need to escape "
With verbatim string's you need to escape "
as ""
If that doesn't work use \u0022
which is unicode equivalent of "
i.e @"^[^,'\u0022]+$|^$"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With