i'm trying to get rid of all non-alphanumeric characters from a form input.
i'm using this piece of code:

Code:
if ($uname != ""){
if(!eregi("^([[:alnum:]_-])$",$uname)) {
$unameError3 = "<LI>Username can only contain alphanumeric characters</LI>\n";
$send = "no";
}
}
it works. but it works a little too well.
it doesn't matter what is submitted, it always resluts in the error.

anyone have any idea of how to go about it?