Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sprint 5:56 PM 23%) HW2 Spring2019 PDF-51 KB Close For this problem,you will construct Python Regular Expressions You are givena Python script called problem2py.You have

image text in transcribed
Sprint 5:56 PM 23%) HW2 Spring2019 PDF-51 KB Close For this problem,you will construct Python Regular Expressions You are givena Python script called "problem2py.You have to construct a regular expression for each of these types of strings (patterns) 1. Amy string that has a cora'(case insensitive, Le upper or lowercase'o (5 points 2. Amy string that contains the sequence 'is' in the word (case insensitive as well) (S points) . Cemail) Any string that has the foBowing properties (15 points) a Has an symbol b Before the symbol, the string can only have one or more alpha numeric characters. This string before the'@can also periods, but it cannot have more than one consecutive period and it cannot end or begin with a period C. The string after the 'symbol can have alphanumeric characters and periods. However, this part ofthe string cannot have consecutive periods, and it cannot start or end with a period Also, this string is required to have at least one period. (Hint: In Python expressions, the needs to be escaped with al he-in regular expressions in Python means any character) CURLAny string that has the following properties: (15 peints) a Begins with the sequence "http/ b Is followed by astring of alphanumeric characters and periods However, this string cannot start or end in a period and cannot have consecutive periods Then can (but doesn't necessanily have to) be followed by a string that starts with a 'f and can have any number of alpha numeric characters or forward slashes C. All you will have to do is fill in the empty quotes in the python script file, in the lines that say YRE1 Whenever you fill out your expressions, if you want to test the strings that it matches, you can uncomment the appropriate block that you want to test (removing In the Blackboard, we are including a sample test file called sample.te. We are also including a file called your program should have for this sample file that has the cerrect output that Email Save

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

More Books

Students also viewed these Databases questions

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago