[thelist] Email Validator

darren darren at web-bitch.co.uk
Wed Dec 5 07:17:02 CST 2001


On 05 December 2001 at 12:57:38, Lachlan Cannon <tiedefenderdelta6 at yahoo.com> wrote:

my reg ex knowledge isn't good, so...

<snip>
LC> then the following may help you out.

LC> var pattern=/(^[
LC> \-_\.a-zA-Z0-9]+)@((([0-9]{1,3}\.){3}([0-9]{1,3})((:[0-9])*))|(([a-zA-Z0-9\-]+)(\.[a-zA-Z]{2,})+(\.[a-zA-Z]{2})?((:[0-9])*)))/;

is there anything wrong with using:

   /^[\w-\.]*[\w-\.]+\@[\w-]+\.+[\w-\.]+[\w]$

as the pattern??

it seems to work with all the valid email addresses i throw at it.

cheers,

darren.





More information about the thelist mailing list