How to validate a text field with regular expression
I want to validate a textfield which is started with number or alphabets but not any speci开发者_如何学Cal symbol like (! @ # etc.) through regular expression.
try like this ^[a-zA-Z0-9][a-zA-Z0-9@#$%^&*]*
this allow string starting with a-zA-Z0-9
and the characters given in second bracket
^[0-9A-Za-z]
\w
represents a word character: [a-zA-Z_0-9]
精彩评论