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= '[email protected]'; $email= preg_replace("/[^A-Za-z0-9]/", " ", $email); echo $email; 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. 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
Archived
This topic is now archived and is closed to further replies.