Hey @andersmurphy,
Just read the PurelyFunctional.tv newsletter, (read issue 330 in full), which mentioned this. You’ve got your solution, but if you’re interested in more context, the newsletter might give you that.
@ericnormand provides an example for E-mail generation. Snipped from the newsletter (hope that’s okay):
(def email-re
#"(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()\[\]\.,;:\s@\"]+\.)+[^<>()\[\]\.,;:\s@\"]{2,})")
(def email-char-re #"[^<>()\[\]\.,;:\s@\"]")
(def gen-email-char
(gen/such-that #(re-matches email-char-re (str %)) gen/char))
(def gen-email-char-string
(gen/fmap #(apply str %)
(gen/not-empty (gen/vector gen-email-char))))
(def gen-email-name
(gen/fmap #(str/join "." %)
(gen/not-empty (gen/vector gen-email-char-string))))
(def gen-email-domain
(gen/fmap (fn [[domain-segs tld1 tld2]]
(str domain-segs "." tld1 tld2))
(gen/tuple gen-email-name
gen-email-char-string
gen-email-char-string)))
(def gen-email
(gen/fmap (fn [[username domain]]
(str username \@ domain))
(gen/tuple gen-email-name gen-email-domain)))
(gen/sample gen-email)
;; => ("‡@¥.ú .²e" "Ø.@ñ.NÎ" "¿G.Ø@ñwßÃ..ëxÂ!" "š¨.Ðâë.¼/.Âù@òÉ.Â.…ë.‚ù"
;; "vu.BÖ¯¢.ƒÍ@þÛü..´Ê!6" "Â.L¹¹èf.Zô.æ@\b*î.0¡6.½.ƒŒ¶"
;; "ÏÂÆ{É.ûÈÉu.âàWN4@7.j1€WÂ.µR*A.Hcõ&E.PE$.òIÛOÚäû"
;; "ž&9ÅÂÇ.Où¸.r¾.Þa&.auj@#mõê.cÓ\\æ÷"
;; "Yù.íï®±|y.ÐNFÕÊ!š.TŒÔéã.ŒP.ipÂðêc}.PŒ@^P.I˸j¤ñ³.óZÀËa.ú}#zvá.Šm.^}öSFjØ.bžÀÊEšcÖ¡"
;; "æ}¯.sÇ.F4.Ý*fÝBº.V.ø.L–¥hôít².³ÒbžÕ@wHföª†«.â·cÔq¬.Yí-§ª.cÞÇ”\bñĽö.Æ×`’.í Oâ.ƒ³«˜Œ.šØ$¨ã§8ÿú/•")