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

Here is the input:

image

And the result:

image

So I gave you the logic for matching a correct format of an email. I you want to stop the pipeline, or throw an error, than you have to make some adjustments.

For example:

$email.match(/[1]+@([\w-]+.)+[\w-]{2,4}$/g) == null ? “fail” : “pass” if you want to use expressions. Other way I can think of is a Data Validator. Select Pattern as a Constraint and enter the regex into Constraint value.


  1. \w-. ↩︎

I tried it via the below test pipeline but it does not work, not sure what I am doing wrong

Email Validator_2021_05_20.slp (6.5 KB)


  1. \w-. ↩︎

bojanvelevski
Valued Contributor

The data format you are streaming is wrong. The data in this pipeline is a re-formated sample from your data.

EmailValidation.slp (3.3 KB)

That work quite great!! thanks a lot

would there be anything required to filter out below types of id’s also ?
complex domains such as country identified like @in.company.com

Update the regex with this one, this is much more precise. There are edge cases which the previous regex can pass, this one won’t. About the complex domains, it would take much more regex tweaking, because after all , these domains are regular, correct, only more complex than the others.

Email Validator2_2021_05_21.slp (3.5 KB)