<html>
<body>
<h1>Regex Modifier: [^eo]</h1>
<p>How many letters in the text "Welcome" are not "e" or "o":</p>
$txt = "Welcome";
$pattern = "/[^eo]/";
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 letters in the text "Welcome" are not "e" or "o":
4The matches were found here:
#e##o#e(Each match was replaced by a # character)