Preg_Match Limit
Posted: Fri Feb 09, 2007 11:52 pm
I have this code:
Is there a way to make it so that the number after the "-" has to be a digit between 1-5 digits? Only 5 digits?
Thanks!
Code: Select all
<?php
$text = "AB-12345";
if(preg_match("/^([A-Za-z]+)\-([0-9]+)$/", $text)){
echo "yes";
}
?>Thanks!