Re: Regex help
| From: | Marcus Bointon | Date: | Wed, 03 Aug 2005 14:57:11 +0000 |
| Subject: | Re: Regex help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219898@lists.php.net to get a copy of this message | ||
On 2 Aug 2005, at 15:12, Robin Vickery wrote:
I don't suppose this is the place for a rant about the futility of checking email addresses with a regexp?Though I will agree with you to some extent, I've had quite a lot of success with this, which is pretty thorough: ^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$ Which I got from here: http://www.hexillion.com/samples/#Regex Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk