Would this be the correct regexp to allow A-Z a-z 0-9
and symbols #&()-\;,.'"
and spaces?
I'm struggling with the '
and "
inside the regexp. Is what I've done correct? Note the \'
and \"
. It just doesn't seem right. Whats the right way to do it?
if (preg_match('/^[a-z0-9#&()-\;,.\'\" ]+$/i', $username) )
{
echo "Good";
}
else
{
echo "Bad";
}