Use regular expression to implement a function which accepts a passed string and check if it is a valid email address. A program accepts user's input and calls the email validation function. If the email is valid, print out the email, username and host. (Rule: word characters (a-zA-Z0-9_ or "w"), dot, and hyphen are considered as valid characters in an email address, besides of one & only one (Sample output as shown in the following figure is for demonstration purposes only.) In [24]: runfile('C:/tmp/units/2020/SIT384-2020-1/portfolio/week2/ Task2.3P.py', wdir='C:/tmp/units/2020/SIT384-2020-1/portfolio/week2') Please input your email address:teste Not a valid email. Please input your email address:shang.gao@test2.server.com email: shang-gao@test2.server.com, username: shang-gao, host: test2.server.com Submission: Submit the following files to OnTrack: 1. Your program source code (e.g. task2-3.py) 2. A screen shot of your program running Check the following things before submitting: 1. Add proper comments to your code

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.4: Character Manipulation Functions
Problem 6E
icon
Related questions
Question
Task description:
Use regular expression to implement a function which accepts a passed string and check if it is a
valid email address. A program accepts user's input and calls the email validation function. If the
email is valid, print out the email, username and host. (Rule: word characters (a-zA-Z0-9_ or "\w"),
dot, and hyphen are considered as valid characters in an email address, besides of one & only one
"@'.)
(Sample output as shown in the following figure is for demonstration purposes only.)
In [24]: runfile('C:/tmp/units/2020/SIT384-2020-1/portfolio/week2/
Task2.3P.py', wdir='C:/tmp/units/2020/SIT384-2020-1/portfolio/week2')
Please input your email address:teste
Not a valid email.
Please input your email address:shang.gao@test2.server.com
email: shang.gao@test2.server.com, username: shang.gao , host:
test2.server.com
Submission:
Submit the following files to OnTrack:
1. Your program source code (e.g. task2-3.py)
2. A screen shot of your program running
Check the following things before submitting:
1. Add proper comments to your code
Transcribed Image Text:Task description: Use regular expression to implement a function which accepts a passed string and check if it is a valid email address. A program accepts user's input and calls the email validation function. If the email is valid, print out the email, username and host. (Rule: word characters (a-zA-Z0-9_ or "\w"), dot, and hyphen are considered as valid characters in an email address, besides of one & only one "@'.) (Sample output as shown in the following figure is for demonstration purposes only.) In [24]: runfile('C:/tmp/units/2020/SIT384-2020-1/portfolio/week2/ Task2.3P.py', wdir='C:/tmp/units/2020/SIT384-2020-1/portfolio/week2') Please input your email address:teste Not a valid email. Please input your email address:shang.gao@test2.server.com email: shang.gao@test2.server.com, username: shang.gao , host: test2.server.com Submission: Submit the following files to OnTrack: 1. Your program source code (e.g. task2-3.py) 2. A screen shot of your program running Check the following things before submitting: 1. Add proper comments to your code
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning