For instance:
'1' => NG '243' => NG '1av' => OK 'pRo' => OK '123k%' => NG
I tried with
/^(?=^[^0-9]*$)(?=[a-zA-Z0-9]+)$/
but it is not working very well.
Use
/^(?![0-9]*$)[a-zA-Z0-9]+$/
This expression has a negative lookahead to verify that the string is not only numbers. See it in action with RegExr.
1.4m articles
1.4m replys
5 comments
57.0k users