I def find enail(s: str) -> str: Given a string , return the enail thot exists in the string. Preconditions: es> contoins at most 1 email, or none ot oll. If cs> does not contain on enail, return the enpty string. Emoil definition: An enail oddress is defined os 'none@donain.com' or 'nane@donain.co with the folloning specifications: name: the nome is an olphonumeric string that is less than or equol to 12 chorocters. Additionol charocters ollowed ore dosh (-), period (.) and underscore ). But the email connot stort or end with these odditional charocters. The none must olso be ot least 1 charocter Long. Example names: ab 0_b AB..C--D Int3r3st. Ing domain: the domain is strictly nunericol, and the number must be divisible by 5. the Length of the donain is unrestricted. Exomple domains: 984125 ending: the enail must end with a (.com) or (.co) (cose sensitive) Note: you mUst not use ony Loops (for, while) here. We want you to just use the re Library for this function. >> find enail('123450_test_enaila165265365.com!) 'a_test enoil@165265365. com reg = "(la-zA-Z0-]{1}[a-zA-ZB-0.J(1,11})@C[0-91+)[5]L.J(la-zA-Z]+)"
I def find enail(s: str) -> str: Given a string , return the enail thot exists in the string. Preconditions: es> contoins at most 1 email, or none ot oll. If cs> does not contain on enail, return the enpty string. Emoil definition: An enail oddress is defined os 'none@donain.com' or 'nane@donain.co with the folloning specifications: name: the nome is an olphonumeric string that is less than or equol to 12 chorocters. Additionol charocters ollowed ore dosh (-), period (.) and underscore ). But the email connot stort or end with these odditional charocters. The none must olso be ot least 1 charocter Long. Example names: ab 0_b AB..C--D Int3r3st. Ing domain: the domain is strictly nunericol, and the number must be divisible by 5. the Length of the donain is unrestricted. Exomple domains: 984125 ending: the enail must end with a (.com) or (.co) (cose sensitive) Note: you mUst not use ony Loops (for, while) here. We want you to just use the re Library for this function. >> find enail('123450_test_enaila165265365.com!) 'a_test enoil@165265365. com reg = "(la-zA-Z0-]{1}[a-zA-ZB-0.J(1,11})@C[0-91+)[5]L.J(la-zA-Z]+)"
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Do not add any imports, the ones that you need will be given to you.
Do not use try-except statements, you should be able to anticipate
or prevent any errors from happening at all!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education