Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Regular Expressions a) Create a regular expression in Python to match the following expressions: [aabc, aaabc,bc, ac]. b) Write an expression in Python to extract

Regular Expressions

a) Create a regular expression in Python to match the following expressions: [aabc, aaabc,bc, ac]. b) Write an expression in Python to extract all email addresses appearing in a line in the following format: firstname.lastname@somecompany.com Here firstname and lastname may contain letters and numbers but no other characters (e.g., John13.Smith or 3Ann.Muller but not Ann!Brown). somecompany may contain only letters and no other characters (e.g., UniBE or NetCo but not Big5 or Smart_City). c) Write an expression in Python to extract all phone numbers appearing in a line in the following formats: (078) 567 55 41 or 078 5675541. Spaces could occur between any digits and the first three digits (without spaces) could be indicated between parenthesis or not.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions