Jaka jest prawidłowa składnia wyrażenia regularnego, aby znaleźć wiele wystąpień tego samego ciągu z preg_match w PHP?PHP preg_match, aby znaleźć wiele wystąpień
Na przykład dowiedzieć, czy następujący ciąg występuje dwa razy w następnym akapicie:
$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";
}
Spróbuj z http: // www .regex-tester.de/regex.html – Gordon