
October 16th, 2012, 03:18 AM
|
|
Registered User
|
|
Join Date: Aug 2012
Posts: 13
Time spent in forums: 1 h 22 m 57 sec
Reputation Power: 0
|
|
|
Regular expression problem
hi,
i am struggling to do basic regular expression that matches
"A1234567", must starts with A and is 8 characters long,
this is what i have so far:
PHP Code:
<?php
$reg1 = "/^[A]+[0-9]{8}/";
$lstring = "A1234567";
if (preg_match($reg1,$lstring))
{
echo "yes";
}
else
{
echo "no";
}
?>
can some one please help
|