djhawthorn
Technical User
I have the following regular expression
return ereg('^[a-zA-Z0-9]*([a-zA-Z]+[0-9]+)|([0-9]+[a-zA-Z]+)[a-zA-Z0-9]*$', $validate);
Which work for validating a character string containing only alphanumerics and ensuring the string contains at least 1 alpha and 1 numeric; but I need to ensure it is also at least 6 characters and no more than 10 characters in length.
I have tried various combinations like
(^[a-zA-Z0-9]*([a-zA-Z]+[0-9]+)|([0-9]+[a-zA-Z]+)[a-zA-Z0-9]*$){6,10} but this doesn't seem to work - is there an easy way to do this?
Cheers.
The dumber they think you are, the more surprised they'll be when you kill them!
return ereg('^[a-zA-Z0-9]*([a-zA-Z]+[0-9]+)|([0-9]+[a-zA-Z]+)[a-zA-Z0-9]*$', $validate);
Which work for validating a character string containing only alphanumerics and ensuring the string contains at least 1 alpha and 1 numeric; but I need to ensure it is also at least 6 characters and no more than 10 characters in length.
I have tried various combinations like
(^[a-zA-Z0-9]*([a-zA-Z]+[0-9]+)|([0-9]+[a-zA-Z]+)[a-zA-Z0-9]*$){6,10} but this doesn't seem to work - is there an easy way to do this?
Cheers.
The dumber they think you are, the more surprised they'll be when you kill them!