Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A. Analyze the regular expression and apply it to the given texts. re = a[ww]+b$ 1. What value does the findall() return when the text

image text in transcribed

A. Analyze the regular expression and apply it to the given texts. re = a[\w\w]+b$ 1. What value does the findall() return when the text is 'aabbbbd'? 2. What value does the findall() return when the text is "aabAbbbc"? 3. What value does the findall() return when the text is 'accddbbjjjb'? B. Create a regular expression so that when it applies to the given text, the following sets of output will be returned. 1. text = "aab#bbbd aabb cddaa', output = ['aab', 'aabb', 'aa'] 2. text='aab#bbbd aabb cddaa abcd', output = ['aab', 'aabb', 'aa', 'ab'] 3. text='aalb#bbb12d alzabb1 cddaa abcd34', output = ['12d', '12a'] C. Create a python program that returns valid email addresses from the text. The general format of an email address is local-part@domain, and a specific example is jsmith@example.com The text input is the following: 1. Melisa Ong, 21 years old, Philippines, ong21@gmail.com 2. Charlie Sung, 25 years old, South Korea, Sung_25@yahoo.com 3. Garry Morales, 19 years old, Philippines, gmorales@dmmmsu.edu.ph 4. Marissa Nang, 34 years old, Brazil, Nang Marissa_Wales@gre, ac, uk The output should be: ['ong21@gmail.com', 'Sung_25@yahoo.com', 'gmorales@dmmmsu.edu.ph', 'Nang Marissa_Wales@gre.ac.uk']

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_2

Step: 3

blur-text-image_3

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

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions