It's supposed to be easy i guess, but I'm stuck at writing a regular expression check for a 8 characters hexadecimal string. That's what I have
<?php
$guids = array(
'14554450',
'afd67554',
'b9f10da8',
'r4345111111111',
't8383837',
'878787'
);
foreach ($guids as $guid){
if(eregi("[a-fA-F0-9]{8}",$guid))
echo $guid . " is a valid guid<br>";
else
echo $guid . " is not valid guid<br>";
}
?>
and the output is
14554450 is a valid guid
afd67554 is a valid guid
b9f10da8 is a valid guid
r4345111111111 is a valid guid
t8383837 is not valid guid
878787 is not valid guid
Line #4 is clearly not a valid string, but the others are fine.
Please help