Skip to content

Instantly share code, notes, and snippets.

@vlrmprjct
Created August 5, 2014 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlrmprjct/79d8ba33ec8c39255d21 to your computer and use it in GitHub Desktop.
Save vlrmprjct/79d8ba33ec8c39255d21 to your computer and use it in GitHub Desktop.
Function to grab emailadresses from plaintext content.
/**
* 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