I don't want to allow a multiple patterns in a string, such as,
$string = "php in stackoverflow"; // multiple spaces not allowed
$string = "php in--stackoverflow"; // multiple hyphens not allowed
$string = "php in__stackoverflow"; // multiple underscores not allowed
etc
So, it works with these lines,
if(preg_match('/\s\s+/', $string)) echo "only a single spaces are allowed";
if(preg_match('/\-\-+/', $string)) echo "only a single hyphens are allowed";
if(preg_match('/\_\_+/', $string)) echo "only a single underscores are allowed";
I also don't want to allow the combination patterns below and the lines above don't work,
$string = "php in -stackoverflow"; // a space with a hyphen not allowed
$string = "php in-_stackoverflow"; // a hyphens with a underscore not allowed
$string = "php in_ stackoverflow"; // a underscore with a space not allowed
etc
Any idea I can achieve this with a simple script?