I am not a regex guy, so I need a little help, just cant get my head around this...
I am writing registration page and using asp.net validators. I need a regex validator to match a special character anywhere within a word, so it will satisfy requirement which says that "ID must have at least one special character." Allowed characters are: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Once again, I am a junior, and having problems with wrapping my head around this stuff at this moment...
For now I have
[\[\]\^\$\.\|\?\*\+\(\)\\~`!@#%&-_+={}'""<>:;, ]{1,}
but it matches numbers as well for some reason, and sometimes don't match characters in the beginning of the word...
So, please, if anyone could help me with that...
You need to escape '-' and '!'
[\[\]\^\$\.\|\?\*\+\(\)\\~`\!@#%&\-_+={}'""<>:;, ]{1,}
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