Skip to content

Instantly share code, notes, and snippets.

@fogus
Created June 27, 2017 17:11
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 fogus/2be82c46718def0da07f2a269395a56e to your computer and use it in GitHub Desktop.
Save fogus/2be82c46718def0da07f2a269395a56e to your computer and use it in GitHub Desktop.
(defn valid-email? [email]
(let [pattern #"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"]
(and (string? email) (re-matches pattern email))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment