Created
July 23, 2018 21:08
-
-
Save clivecorbishley/fe882912c963cdb8d7964ff2cdc04990 to your computer and use it in GitHub Desktop.
Ruby email regex snippets
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
'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