This question already has an answer here:
- PHP regular expressions: No ending delimiter '^' found in 3 answers
I am writing a regular expression to extract a pattern of numbers from a string. When I used to run the below code snippet, it is showing a warning
"preg_match() [<a href='function.preg-match'>function.preg-match</a>]: No ending delimiter '^' "
Could any one tell me why this warning and how to fix it?
$temp=0;
$exp=(explode(" ",$message1));
while($temp<sizeof($exp))
{
if(preg_match("^(+91|0091|0)?[7-9][0-9]{9}$",$exp[$temp]))
{
$pat=$exp[$temp];
}
}