Possible Duplicate:
php regular expressions No ending delimiter ‘^’ found in
The code is as follows:
if(preg_match($exp, $value)){
return "";
}
- the value of
$expis:^[0-9]*$ - the value of
$valueis:7
and the output gives :
Warning: preg_match() [function.preg-match]: No ending delimiter ‘^’ found in /…
$expshould be something like/^[0-9]*$/for it to work the way you intended. It is assuming^is your regex delimiter, because it is the first character – you’d want your first char to be something else. See preg_match manual entry for details.