In the above example the variable $rule
is receiving a pattern that matches anything non-alphanumeric.
To validate alphanumeric, this pattern will probably be used to replace everything that matches it with a zero-length string ("").
If you want to know if it is possible for a non-alphanumeric character to remain in the String after the substitution, the answer is NOT .
$string = 'qualquer coisa !@#$%¨&())_+';
$rule = "/[^A-Za-z0-9]/";
$resultado = preg_replace($rule, "", $string);
echo $resultado;
Result:
any thing
Notice that space has not even passed.
It is only possible to circumvent a regular expression if there are any errors in its elaboration. Otherwise, as in the example quoted, does not give .