if(preg_match("%(?=.{8})[A-Za-z0-9]([.-]{0,1})%", stripslashes(trim($_POST['username']))))
I want the username to be at least 8 characters A-Za-z0-9 with only 1 . or 1 - . How do I implement this? My code is allowing a username of ".............." as valid. <- Don't want that.
BTW: the "." or "-" is meant to be optional.