I am not quite understanding how this how ereg and Preg_match thing works. I am trying to prevent users from creating a username that is less than 3 characters, with no capital letters, and no special characters and cannot be a reserved user id such as root, admin, and operator and can not include things like dashes, spaces or !@#$%(special characters)
I am wondering if I am headed in the right direction
this is what I have so far
$pattern = '/[^A-Z0-9[:space:].|-|,|$|!|?|%|!]{3,25}$/';
if ($password==$repeatpassword)
{
if (preg_match($pattern, $username)) {
echo "Username must be be at least 3 characters, all lowercase and contain no special characters";