I have a large list of emails I am running through. A lot of the emails have typos. I am trying to build a string that will check valid emails.
this is what I have
I guess the example from the book can be improved to match emails with - in subdomain.
-
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
For example:
> 'some@email.with-subdomain.com' =~ VALID_EMAIL_REGEX => 0