Skip to content

Commit

Permalink
Merge pull request #22 from eccentricOrange:drafting
Browse files Browse the repository at this point in the history
Fix email regex to include all valid domain names
  • Loading branch information
eccentricOrange authored Dec 20, 2023
2 parents 7a29498 + 038f399 commit bf0fdb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ However, Python has a feature called named groups. This allows you to name a gro
import re

## An email regex with named groups
email_regex = r"^(?P<username>[a-zA-Z0-9_.+-]+)@(?P<domain>[a-zA-Z0-9-])\.(?P<tld>[a-zA-Z0-9-.]+)$"
email_regex = r"^(?P<username>[a-zA-Z0-9_.+-]+)@(?P<domain>[a-zA-Z0-9-]+)\.(?P<tld>[a-zA-Z0-9-.]+)$"

# test
match = re.match(email_regex, "someone@example.com")
Expand Down

0 comments on commit bf0fdb9

Please sign in to comment.