Last active
March 2, 2019 15:55
-
-
Save mtrencseni/a2ed2d2b63325687afa1b31ee3c1136a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# regex pattern: [\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6} | |
# equivalent rxe code: | |
username = rxe.one_or_more(rxe.set([rxe.alphanumeric(), '.', '%', '+', '-'])) | |
domain = (rxe | |
.one_or_more(rxe.set([rxe.alphanumeric(), '.', '-'])) | |
.literal('.') | |
.at_least_at_most(2, 6, rxe.set([rxe.range('a', 'z'), rxe.range('A', 'Z')])) | |
) | |
email = (rxe | |
.exactly(1, username) | |
.literal('@') | |
.exactly(1, domain) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment