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
This works good for me:
if email.match?('[a-z0-9]+[_a-z0-9\.-]*[a-z0-9]+@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})') puts 'matches!' else puts 'it doesn\'t match!' end