arbitrageur Posted November 17, 2014 Share Posted November 17, 2014 Hello, Is it possible to allow '@' and '.' while maintaining the rest of this regex? $email= 'adsfsa@asdf.edu'; $email= preg_replace("/[^A-Za-z0-9]/", " ", $email); echo $email; Quote Link to comment https://forums.phpfreaks.com/topic/292511-allow-and-for-email-filtering/ Share on other sites More sharing options...
requinix Posted November 17, 2014 Share Posted November 17, 2014 That [^] has the characters to allow. If you want to allow @ and . then all you have to do (at least for those two in particular) is to add them to the set. 1 Quote Link to comment https://forums.phpfreaks.com/topic/292511-allow-and-for-email-filtering/#findComment-1496779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.