开发者

Need Alphanumeric Regex

My text box accept alp开发者_如何学Gohanumeric and on submit button click I need to make sure that textbox contains should at least 1 char (a-z|A-Z) and 1 digit (0-9).

Please help me in regex pattern.


/[a-zA-Z]+[0-9]+/ Should be what you need

edit

Here's one that takes either alpha->numeric or numeric->alpha:

([a-zA-Z]+[0-9]+)|([0-9]+[a-zA-Z]+)

Note that you need to match_all because this will match each group of letter-number and number-letter as individual matches.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜