Created
August 5, 2014 07:57
-
-
Save vlrmprjct/79d8ba33ec8c39255d21 to your computer and use it in GitHub Desktop.
Function to grab emailadresses from plaintext content.
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
/** | |
* FUNCTION TO GRAB EMAILADRESSE FROM ANY PLAINTEXT | |
* @param text | |
* @returns {*|Array|{index: number, input: string}} | |
*/ | |
var getEmail = function(text) { | |
return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment