Hey! muchas gracias, pero aunqu no me resulto con el patron que me diste, arregle unas cositas por aqui y por alla y me resulto al fin :)
function sanitizar_nick($nick){
// limpiamos 1
$nick = trim($nick);
$nick = stripslashes($nick);
$nick = strip_tags($nick);
// si el nick no coincide con el patron entonces devuelve vacio
if (!eregi("^([-a-z0-9_]|\^|\[|\]|\s)+$",$nick)){
return "";
} else {
return $nick;
}
}
gracias por todo, y aqui les dejo un tutorial muy bueno, de expresiones regulares de BULMA (sitio muy bueno, publicidad aparte xD)
http://bulmalug.net/body.phtml?nIdNoticia=770&nIdPage=2