Hi im trying to get my regular expression to work, im pants at it and when i look at the patterns my brain melts ?
I want my regEX to only accept alpha numberical characters underscores [COLOR=”Red”]–[COLOR=”red”].
check here [url]http://www.liquidfists.com/index2.php?page=signup
[code=php]
//CHECK USERNAME AND PASSWORD FOR VALID CHARICTERS
if (preg_match(‘/^[w.-]+$/’, $user_name) {
$login_warn_msg=’You have entered invalid characters in the username field.’;
$login_warn='<p class=”warning”>’.$login_warn_msg.'</p>’.”n”;
$login_warn.=$login_form;
echo $login_warn;
exit();
}
for example if i try and register the username testperson it says that i have invalid characters even though i dont because they all match alpha numberical characters underscores [COLOR=”Red”]–[COLOR=”red”].
anyhelp would be greatly appreciated.