Created
July 20, 2021 19:34
-
-
Save emoran/f0d9fa6dc5126a09a12b85d79823ebb2 to your computer and use it in GitHub Desktop.
validate email in dataweave 1.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 1.0 | |
%input payload application/json | |
%output application/json | |
%var pRegex = /^[^.][a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0-9-](?!.*?\.\.)[^_ ; ,<>\/\\]+(?:\.[a-zA-Z0-9-]+)[^.]*$/ | |
--- | |
payload filter ($.email != "" and $.email != null and ($.email matches pRegex)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment