For example I want .brewpixels
and brewpixels.
to echo
your username is invalid
If the dot is anywhere between the first and last letter the script should echo
your username is good
How do I change my regex to accomplish this?
$username = 'brew.pixels';
if(preg_match('/(^\d|[^\w])/', $username)){
echo 'your username is invalid';
} else {
echo 'your username is good';
}