survival / donation-system

:gem: Gem containing Survival's donation system logic
https://donation-system-staging.herokuapp.com/
MIT License
2 stars 3 forks source link

Implement proper email validation #41

Open octopusinvitro opened 6 years ago

octopusinvitro commented 6 years ago

See our contributing guides.

The internet and the different gems out there don't seem to agree on which is the ultimate regex to validate emails:

%r{/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/},

%r{/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/},

%r{/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i},

%r{/^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,4},*[\W]*)+$/},

%r{/\w+@\w+\.{1}[a-zA-Z]{2,}/}

# ... and more...

Find a way to validate emails properly, etiher with regex or something else