I'm making up fake email addresses and I just want to make sure they are in a valid email format so I'm trying to remove any character that is not in the set below:
$jusr['email'] = preg_replace('/[^a-zA-Z0-9.-_@]/g', '', $jusr['email']);
I haven't had any trouble on my windows machine, but on the linux dev server I get this error each time this code runs:
Warning: preg_replace() [function.preg-replace]: Unknown modifier 'g' in /var/www/vhosts/....
I think it's the regex string, but I can't pin it down. Little help? Thanks.
Clarification: I'm not trying to accommodate all valid email addresses (unnecessary for my purpose), I just need to figure out what's wrong with my preg_replace regex.