cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Need to know email address validation logic

vaidyarm
Contributor

Hi,

I need to setup a logic to filter out only valid email address, might use that logic in filters, conditional or mappers. logic should able decide which email address valid.

For ex : test@test687 is invalid and test@test687.com or test@test687.edu etc are valid

Thanks

12 REPLIES 12

Thanks, A Lot, This one is much better covers a lot of varying emails

ForbinCSD
Contributor

@vaiyarm -

You can do a DuckDuckGo Search (or snooptastic Google, if you prefer) on โ€œe-mail address validation regexโ€ (try removing the word regex or replacing with the full word, or the word โ€œpatternโ€ or โ€œparsingโ€) and you should get a lot of hits. The most comprehensive validator that Iโ€™ve found was written in C# for CLR / dotNet: it could handle ALL valid internet e-mail addresses, including those with complex domain names.

That particular regex had several drawbacks:

  • uses C# regex syntax, and requires translation to Javascript .
  • excessively long regex (in the neighborhood of 200-300 characters!)
  • thus incredibly complex and difficult to proofread or to troubleshoot.

Personally, Iโ€™d prefer having to copy a hundred lines of parsing code (if relatively straightforward and clear) than to try to get such a fierce regex working. It can, however, be done!

Try reading the below for more reasons why you might want to use a real parser and not a regexโ€ฆ