Finding Repeated Words
<?php function showMatchResults($str) { if (preg_match("/\b(\w+)\s+\\1\b/i", $str)) { echo "Match successful: '" . $str . "'\n"; } else { echo "Match failed: '" . $str . "'\n"; } } showMatchResults("Hello World!"); ?>