I need a help with regex which checks the string contains only letter and numbers but not only numbers
Valid
* letters
* 1wret
* 0123chars
* chars0123
*
^(?=.*[a-z])[a-zA-Z0-9]+$
(?=.*[a-z])
positive lookahead to make sure that there is at least one letter in the string (but doesn't consume any characters - gives up the matched characters as soon as it returns (in this case, as soon as it finds a letter)).[a-zA-Z0-9]+
make sure string contains only alphanumeric characters.^
and $
are start and end of string delimiters.