Simple RegEx question [SOLVED]
Posted: Wed Nov 02, 2005 10:18 am
I'm sure this will be pretty easy for someone out there but I can't quite get it. I've got two different ways of accessing the same script to send mail but they format the e-mail slightly different both times. One form formats the email addy properly name@domain.com but the other formats it as name@domain.com@. I want to check the variable in the mail script to see if it has the excess @ at the end and trim it if so. My current regex is written. . .
Any ideas?
Code: Select all
if (preg_match ('/[@]{2}/',$email)){
echo 'Multiple @'s';
}