Browse Source

Slightly more readable regular expression

master
Stephen Starkey 2 years ago
parent
commit
161366590a
  1. 2
      src/clj/email_counter/emails.clj

2
src/clj/email_counter/emails.clj

@ -19,7 +19,7 @@
return that concatenated onto the domain. Otherwise, return nil"
[email :- (s/maybe s/Str)]
(let [email (parse-email email)
[_ n d] (when email (re-matches #"^(.*?)(@[^@]+$)" email))
[_ n d] (when email (re-matches #"^(.*?)(@[^@]+)$" email))
n (some-> n (str/replace #"\." "") (str/replace #"\+.*" ""))]
(when-not (str/blank? n) (str n d))))

Loading…
Cancel
Save