<html>
<body>
<h1>Regex Modifier: \b</h1>
<p>Does the text "Hello World" start with "Hel"?:</p>
$txt = "Hello World";
$pattern = "/\bHel/";
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>
Does the text "Hello World" start with "Hel"?:
1The matches were found here:
#lo World(Each match was replaced by a # character)