We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c03431b commit 09d4b54Copy full SHA for 09d4b54
chapter_1/regex/email.py
@@ -0,0 +1,5 @@
1
+import re
2
+
3
+email = re.compile(r'(?P<user>[\w.]+)@(?P<domain>\w+)\.(?P<suffix>[a-z]{3})')
4
+text = "My email is [email protected] or [email protected]"
5
+print(*(x.groupdict() for x in email.finditer(text)))
0 commit comments