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.
精彩评论