regexp pattern that match only alphanumeric
^([a-z0-9]+)$ or you can do this
^([a-zA-Z0-9]+)$
php sample
if(preg_match('/^([a-z0-9]+)$/',$username,$match)){
print_r($match);
}
^([a-z0-9]+)$ or you can do this
^([a-zA-Z0-9]+)$
php sample
if(preg_match('/^([a-z0-9]+)$/',$username,$match)){
print_r($match);
}
Reply