Created
May 1, 2014 16:34
-
-
Save guyellis/11455744 to your computer and use it in GitHub Desktop.
Allows a list of space,comma,semicolon,tab and newline delimited emails to be parsed into an array.
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
// Accepts a single paramater which is one or more emails separated | |
// by space,comma,semicolon,tab, or newline. | |
// Returns an array of tokens that should be emails | |
// Does not validate emails to see if they are well formed. | |
exports.parseEmails = function(emails) { | |
return emails.toLowerCase().split(/[\s,;\t\n]+/); | |
}; | |
Thank you!! Very useful
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, it solves my problem!