Advertisement
drkskwlkr

Collect and format emails from JSON returned by Google Sheets

Dec 25th, 2022
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.30 KB | Source Code | 0 0
  1. const regex = /\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,24})+/gm ;
  2. const input = 'MAP_PABBLY_OUTPUT_FROM_PREVIOUS_STEP_HERE' ;
  3.  
  4. let results = input.match(regex) ;
  5. let list = [] ;
  6.  
  7. for (let result of results){
  8.   list.push(`{"emailAddress" : {"address" : "${result}"}}`) ;
  9. }
  10.  
  11. return list.join(', ') ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement