Question: write one or more regular expressions to verify that a given string contains: (1) a valid currency (2) a valid date (3) a valid telephone

write one or more regular expressions to verify that a given string contains: (1) a valid currency (2) a valid date (3) a valid telephone number and it does not contain any html opening tags such as or closing tags such as Here are some examples of a valid currency: $954.49 $10,724.00 $1,000,000,023.45 -$250,000,456 +$234,922.99 USD45M $25K $4B Here are some examples of valid dates: January 05, 1960 6/1/00 04-Jul, 2004 2021-20-01 Here are some examples of valid phone numbers: 6012664949 +1 601 266-4949 (601)-266-4949 001-601-266-4949 You can assume all valid values would look similar to the examples shown above. Write 4 different modules and name them as currency.py, date.py, phone_numbers.py and tags.py. Create an driver.py file and import what you need from each module. Create an input.txt file and copy paste the above examples into input.txt and add additional text to each line. For example, you could type, "January 05, 1960 was a cold day, I suppose" and "I do remember 04-Jul, 2004!!". Add examples for 4 different html tags. Put all the files in directory YourName_HW1. I will run your file from the commandline like python YourName_HW1/driver.py. Your code should print the input line and output of the functions you chose for pattern matching from the re module. Recall that re module has many functions such as findall, search, fullmatch, match, etc. You need to choose the correct one for pattern matching for each input and pattern pairs. If you use more than one regular expression for processing each type of input string then output each result.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!