Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: If you use the regex editor to design your modified regex, do not forget to change the mode to global & multi-line in the

image text in transcribed

Note: If you use the regex editor to design your modified regex, do not forget to change the mode to global \& multi-line in the regex editor. In the below image, there are four names. The following regular expression matches the first two and last names. \w{3,}\s(\w\s)?\w{3,} Note: while the above regex expression was authored to also match other names of interest (not shown), you can focus on just the 4 example names. Modify the above regex expression to result in only the following matches: John-DoeJohn-M=DoeJohn-Mr-DoeJohn-Deere Then incorporate the regex into a program to search for the regex - so, use re.search(). Iterate over the names, and if the regex is not found, print 'No match found'. If found, print the match object. import re myText=open(Johns.txt,encoding="IS0-8859-1")

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions