Question
In Python, lets use regex. Write a function called search_email that returns a regex pattern using re.search or re.findall to match all contents like email
In Python, lets use regex.
Write a function called search_email that returns a regex pattern using re.search or re.findall to match all contents like email id and domain, except the @, in a typical email address,
In other words, the regex should capture everything left to the @ symbol and right to the @ symbol. For email id (i.e. the part left to the @ symbol), content before and after period should be captured.
Here are examples:
>>> re.search (search_email ( ), chegg.study@orange.net' ).groups( ) >>> (chegg, study, orange.net')
Make sure to consider other emails like
chegg.01234@get.imail.net >>> ('chegg', '01234', 'get.imail.net')
CHEgg.stuDY@imail.net >>>('CHEgg', 'stuDY', 'imail.net')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started