05-19-2021 04:40 AM
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
05-20-2021 12:52 AM
Here is the input:
And the result:
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.
\w-. ↩︎
05-20-2021 01:01 AM
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)
\w-. ↩︎
05-20-2021 01:22 AM
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)
05-20-2021 01:35 AM
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
05-21-2021 02:40 PM
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)