$pattern = '/^(^[\`\~\@\#\$\%\^\&\\])+$/';
if(preg_match($pattern, $textToSearch)){
exit('Bad text.');
}
The code above is supposed to exit upon the first occurrence of any element in the pattern above. But it is not working. Will anyone please help me arrive at a working code sample?