if(preg_match('/^ (?=.*[A-Za-z]) # at least one letter somewhere [A-Za-z0-9]+ # letter or number in first place ([-.](?![-.]) # a . or - not followed by . or - | # or [A-Za-z0-9] # a letter or a number ){0,60} # this, repeated from 0 to 60 times - at least two characters [A-Za-z0-9] # letter or number at the end $/x',$nameToCheck) == 0 && $wampConf['NotCheckVirtualHost'] == 'off') {