Location: PHPKode > projects > ObsceneClean > testcents.php
<?PHP
$iOffset = 0;
/**
$Str = "get the fu¢k out shit fag";
$usethis = '/([f]{1,15}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[u]{1,15}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[c\xA2\xA9\x80]{1,15}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[-_^.,`~\'\s]{0,15}[!@#$%&*\/\+=\(\)\\]{0,2}[k]) | ((?=([^\*]*?\*[^\*\s]*?))f[-_^.,`~\'\s]{0,15}[u\*][-_^.,`~\'\s]{0,15}c[-_^.,`~\'\s]{0,15}k)/ixu';
$TempArray = array();
$Str = 'get the fu¢k out shit fag';
echo '<br> try=' . $Str;
echo '<br> ';
var_dump($Str);
$rtcode = preg_match_all($usethis, $Str, $TempArray, PREG_OFFSET_CAPTURE, $iOffset);  
echo ' <br> $rtcode=' . $rtcode;
if (!$rtcode) echo '<br> NO  match';
if ($rtcode)
{
			echo '<br> something matched! OW=';
			var_dump($TempArray[0]);
}
else 
$Str = "get the fuck out shit fag";
echo '<br> now try=' . $Str;
echo '<br> ';
var_dump($Str);
if (preg_match_all($usethis, $Str, $TempArray, PREG_OFFSET_CAPTURE, $iOffset) > 0)  
{
			echo '<br> something matched! OW=';
			var_dump($TempArray[0]);
}  **/
echo '<br> try simple regex';
$usethis = '/([L][o][o\xA2\xA9\x80][k])/ixu';
$Str = 'Look up my friend';
echo '<br> $str=';
var_dump($Str);
$rtcode = preg_match_all($usethis, $Str, $TempArray, PREG_OFFSET_CAPTURE, $iOffset);  
echo ' <br> $rtcode=' . $rtcode;
if (!$rtcode) echo '<br> NO  match';
if ($rtcode)
{
			echo '<br> simple regex matched! $TempArray=';
			var_dump($TempArray[0]);
}

echo '<br> try matching copyright sign -hex A9';
$usethis = '/([L][o][o\xA2\xA9\x80][k])/ixu';
$Str = 'Lo©k up my friend';
echo '<br> $str=';
var_dump($Str);
/** $Str = htmlspecialchars($Str, ENT_QUOTES);
echo '<br> after htmlspecialchars $str=';
var_dump($Str); **/
$rtcode = preg_match_all($usethis, $Str, $TempArray, PREG_OFFSET_CAPTURE, $iOffset);  
echo ' <br> $rtcode=' . $rtcode;
if (!$rtcode) echo '<br> NO  match';
if ($rtcode)
{
			echo '<br> simple something matched! $TempArray=';
			var_dump($TempArray[0]);
}
?>
Return current item: ObsceneClean