Hello, I can't seem to come up with a regular expression that will check to see if there are both letters AND numbers. I could only make it so it would check if it was Alphanumeric, but how can I make it so it will only return if BOTH letters and numbers are present:
The above string will output ifPHP Code:if(preg('[A-Za-z0-9]', $string))$message = "Alphanumeric";
echo $message;
$string="123";or$string="abc";. But I onlywant it to output if$string="abc123";
What is the correct Regular Expression for this?
Thanks,



Reply With Quote


Bookmarks