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.
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
The dumber they think you are, the more surprised they'll be when you kill them! ![[machinegun] [machinegun] [machinegun]](/data/assets/smilies/machinegun.gif)
![[rofl2] [rofl2] [rofl2]](/data/assets/smilies/rofl2.gif)
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.
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
![[laughtears] [laughtears] [laughtears]](/data/assets/smilies/laughtears.gif)
![[machinegun] [machinegun] [machinegun]](/data/assets/smilies/machinegun.gif)
![[rofl2] [rofl2] [rofl2]](/data/assets/smilies/rofl2.gif)