Skip to content

Instantly share code, notes, and snippets.

@rpietro
Created July 26, 2013 16:14
Show Gist options
  • Save rpietro/6090156 to your computer and use it in GitHub Desktop.
Save rpietro/6090156 to your computer and use it in GitHub Desktop.
extracts email addresses from a string
address <- c("whatever, [email protected]", "nothing here","right, [email protected]", "blablabla [email protected]")
emailpattern <- '[[:alnum:]\\-_.%+]+@[[:alnum:]\\-_.%+]+\\.[[:alpha:]]+'
email_addresses <- str_extract_all(string = address, emailpattern)
email_addresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment