I've been reading and reading on regular expressions, but I can't figure out what's wrong with my code:
if(eregi("^[A-Za-z0-9_\-]$", $username)){return true;}
It never returns true. I'm trying to validate usernames and only allow lowercase a-z, uppercase a-z, numbers, hyphens and underscores.