Created
October 10, 2019 20:25
-
-
Save gvolpe/cc7fc4589d1de631faaa5dcb48ef732e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try:
type EmailPred = MatchesRegex[W.`"""(^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$)"""`.T]