Forum Discussion
This did not work, used it for the below invalid id’s but do not work
automatedclean@00d5g000005evyzea4
autoproc@00d5g000005evyzea4
noreply@00d5g000005evyzea4
-
\w-. ↩︎
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-. ↩︎
adam_gataev - you have the right terminology. Just use a Mapper as follows:
Here I'm just using two Array methods: concat() and pop() to complete your goal in one expression. The Array.pop() removes the last element and returns that element. The Array.concat() creates a new array with the new element added in.
Note that I'm also using the "pass-through" option on the Mapper settings. This allows any other elements in the input doc to flow through to the target path without specifying them.
Hope this helps!
- adam_gataev3 months agoNew Contributor II
You're the man koryknick, thank you so much!
Related Content
- 3 years ago