Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started