Hay all, i need help making a regex. The string must contain a "-" and must not contain a ".".
Can someone help me please.
Hay all, i need help making a regex. The string must contain a "-" and must not contain a ".".
Can someone help me please.
You don't need a regex for that:
if (strpos($string, '-') !== false && strpos($string, '.') === false)
//do what you want...
no need regex for this, one method is to use strpos
strpos($mystr,"-" ) !== FALSE && strpos($mystr,"." ) === FALSE