Can someone help a regex noob?
my code:
$text = "clapham junction 1989";
$regexp = "[0-9][0-9]{3}";
$dummy = preg_match($reg exp, $text, $matches);
echo $matches[0];
produces the error:
Warning: preg_match() [function.preg-match]: Unknown modifier '[' in
blah blah blah
Have I got the regex wrong? I'm trying to return any 4 digit number in
$text.
thanks in advance
Garry
my code:
$text = "clapham junction 1989";
$regexp = "[0-9][0-9]{3}";
$dummy = preg_match($reg exp, $text, $matches);
echo $matches[0];
produces the error:
Warning: preg_match() [function.preg-match]: Unknown modifier '[' in
blah blah blah
Have I got the regex wrong? I'm trying to return any 4 digit number in
$text.
thanks in advance
Garry
Comment