<html>
<body>
<h1>Regex Modifier: [co]</h1>
<p>How many occurences of the letters "c" or "o" are in the text "W3Schools.com":</p>
$txt = "W3Schools.com";
$pattern = "/[co]/";
echo preg_match_all($pattern, $txt);
<p>The matches were found here:</p>
echo preg_replace($pattern, "#", $txt);
<p>(Each match was replaced by a # character)</p>
</body>
</html>
How many occurences of the letters "c" or "o" are in the text "W3Schools.com":
5The matches were found here:
W3S#h##ls.##m(Each match was replaced by a # character)