email address as username

I have a code for username that I want to change to accept special characters, such as @

Current line:
if (!preg_match(’/^[-a-zA-Z0-9_. ]+$/’, $this->username)) {

I want to change it to:
if (!preg_match(^\w+@[a-zA-Z_]+?.[a-zA-Z]{2,3}$this->username)) {

Do you think it’ll work?

Thanks,

Sponsor our Newsletter | Privacy Policy | Terms of Service