Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Email Vali8dation Problem Date: Wed, 23 Jan 2013 15:27:43 -0700 Lines: 38 Message-ID: X-Trace: individual.net DsrfvEGFNfQkgWs2H7iJHgL6Vtk4D/9Xcsf/b+jr5Qbm76oKOEqTxli5n2gxXb/C2q Cancel-Lock: sha1:DkobOb/qA4DRyM0F+c8PvDnm3/0= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: csiph.com comp.lang.javascript:18227 Hi: I have the following undernoted isEMail() function defined in the section of a page This function returns false for: m.smith@example.com But this is (I believe)a validly-formatted email address and should return 'true', And, also: m.smith@dumbo.example.com also, obviously returns 'false'. Woud someone take a 'stab' at correcting the regex expression below to allow the above formatted email addresses to return 'true'. btw, google brings up dozens of variations for this task, but I'd like to get the 'perfect' one :(( Thanks ! -- Mel Smith ***** my isEmail() function *** function isEmail(email) { return /^([a-zA-Z0-9_\-])+\@(([a-zA-Z0-9\-])+)+(\.[a-zA-Z]{2,6})(\.[a-zA-Z]{2})?$/i.test(email) ; } ***********************