Hi,
I have a
String of between 1 and 5 chars in length. It must contain at least one alphabetic character (i.e. a-zA-Z). The rest can be numeric or spaces. Is is possible to validate this using regex?
For example:
1aa is valid
123 is not valid
I tried using:
^[a-zA-Z]{1,5}$
but it doesn't work if there are any numerics in the string.
I also tried
^[a-zA-Z]{1,}$ and some other variations.
Can anybody give me any pointers as to where I'm going wrong?
Thanks,
John