Skip to content

Instantly share code, notes, and snippets.

@clivecorbishley
Created July 23, 2018 21:08
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 clivecorbishley/fe882912c963cdb8d7964ff2cdc04990 to your computer and use it in GitHub Desktop.
Save clivecorbishley/fe882912c963cdb8d7964ff2cdc04990 to your computer and use it in GitHub Desktop.
Ruby email regex snippets
'email@email.com' =~ URI::MailTo::EMAIL_REGEXP
'email@email.com;split.tes2email@wwwwwww.co.za'.split(';').map { |v| v =~ URI::MailTo::EMAIL_REGEXP }
'email@email.com;split.tes2email@wwwwwww.co.za'.split(';').map { |v| v =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment