I want to accept an input with lowercaps only either with hyphens, numbers, or alphabets, and at least 6 characters. But the regex below accepts Upper case as long as the input is longer than 6 characters.
$user_name = 'BloggerCathrin';
if(!preg_match('/([a-z0-9]{6}|[a-z0-9\-]{6})/', $user_name))
{
echo 'please use lowercaps only, either with hyphens, numbers, or alphabets, and at least 6 characters.';
}
How can I fix that?