Question: Programming Language: Python 2. Write a computer program for identifying social security numbers in text using a single regular expression. (30 points) The social security

 Programming Language: Python 2. Write a computer program for identifying socialsecurity numbers in text using a single regular expression. (30 points) Thesocial security numbers consists of: 9 digits must be preceded by one

Programming Language: Python 2. Write a computer program for identifying social security numbers in text using a single regular expression. (30 points) The social security numbers consists of: 9 digits must be preceded by one or more spaces or beginning of line must be followed by one or more spaces or ends of line In addition there are certain restrictions: first three digits cannot be all zeros last four digits cannot be all zeros nine digits can all be next to each other or there can be a hyphen between: o third and fourth digit, and O fifth and sixth digit The following are well formed social security numbers: 123456789, 123-45-6789. The following are ill-formed social security numbers: 000-23-4567, 123-45-0000. There is no valid social security number on the following line: 12345678910 is a big number, 345-678-910 is a lotto number and 3333333334 is a 10 digit number Note: Your program should accept a ".txt" file as command-line argument and print all the matching social security numbers present in the input .txt file on the screen. . 2. Write a computer program for identifying social security numbers in text using a single regular expression. (30 points) The social security numbers consists of: 9 digits must be preceded by one or more spaces or beginning of line must be followed by one or more spaces or ends of line In addition there are certain restrictions: first three digits cannot be all zeros last four digits cannot be all zeros nine digits can all be next to each other or there can be a hyphen between: third and fourth digit, and fifth and sixth digit O The following are well formed social security numbers: 123456789, 123-45-6789. The following are ill-formed social security numbers: 000-23-4567, 123-45-0000. There is no valid social security number on the following line: 12345678910 is a big number, 345-678-910 is a lotto number and 3333333334 is a 10 digit number. 2. Write a computer program for identifying social security numbers in text using a single regular expression. (30 points) The social security numbers consists of: 9 digits must be preceded by one or more spaces or beginning of line must be followed by one or more spaces or ends of line In addition there are certain restrictions: first three digits cannot be all zeros last four digits cannot be all zeros nine digits can all be next to each other or there can be a hyphen between: o third and fourth digit, and o fifth and sixth digit The following are well formed social security numbers: 123456789, 123-45-6789. The following are ill-formed social security numbers: 000-23-4567, 123-45-0000. There is no valid social security number on the following line: 12345678910 is a big number, 345-678-910 is a lotto number and 3333333334 is a 10 digit number. Note: Your program should accept a .txt file as command-line argument and print all the matching social security numbers present in the input .txt file on the screen

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!