Skip to content

Instantly share code, notes, and snippets.

@gvolpe
Created October 10, 2019 20:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvolpe/cc7fc4589d1de631faaa5dcb48ef732e to your computer and use it in GitHub Desktop.
Save gvolpe/cc7fc4589d1de631faaa5dcb48ef732e to your computer and use it in GitHub Desktop.
import eu.timepit.refined._
import eu.timepit.refined.api.Refined
import eu.timepit.refined.auto._
import eu.timepit.refined.string.MatchesRegex
object refinements {
type EmailPred = MatchesRegex[W.`"""(?=[^\\s]+)(?=(\\w+)@([\\w\\.]+))"""`.T]
type Email = String Refined EmailPred
}
@Allysh0w
Copy link

Does not work

@daddykotex
Copy link

daddykotex commented Sep 30, 2022

try: type EmailPred = MatchesRegex[W.`"""(^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$)"""`.T]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment