How to match a string that does not contain a period (.) Using a regular expression?

advertisements

How to match a string which doesn't contain a dot (.) using regular expression ?


why regex??

$str="string_with_no_dots";
if (  strpos ($str,"." ) === FALSE ){
 print "ok, no dots\n";
}