'#^([a-z]+).(([a-z]+).([a-z]+)|([a-z])+) #'
if (preg_match('/^([a-z0-9_\-]+\.)?[a-z0-9_\-]+\.[a-z]{2,4}$/i',$text)) echo $text."<br>";