开发者

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]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜