正则表达式在PHP中使用preg_match查找多个匹配的字符串的正确语法是什么?PHP preg_match找到多个匹配
例如,如果发现以下段落中出现两次以下字符串:
$string = "/brown fox jumped [0-9]/";
$paragraph = "The brown fox jumped 1 time over the fence. The green fox did not. Then the brown fox jumped 2 times over the fence"
if (preg_match($string, $paragraph)) {
echo "match found";
}else {
echo "match NOT found";
}
以http尝试:// WWW .regex-tester.de/regex.html – Gordon 2010-01-08 19:06:47