<html>
<body>
<h1>正则表达式修饰符:o{3}</h1>
<p>在文本 "W3School is goood" 中,有多少个连续出现 3 个 o(ooo)的情况?</p>
$txt = "W3School is goood";
$pattern = "/o{3}/";
echo preg_match_all($pattern, $txt);
<p>匹配到的位置如下:</p>
echo preg_replace($pattern, "#", $txt);
<p>(每个匹配项被替换为 # 字符)</p>
</body>
</html>