Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using regular expressions, write a complete Perl script that, when given the input from a sample as shown below, displays ONLY the valid phone numbers

Using regular expressions, write a complete Perl script that, when given the input from a sample as shown below, displays ONLY the valid phone numbers found anywhere in the file. For this example assume a phone number is valid only if it is in the following form (where 9 represents anynumber):

(999)-999-9999

Sample Input:

this is a test 12345676867 (123)-456-7890 My number: (123)-555-1212 test 9999 test. A phone number ((123)-999-0000) exists on this line. There is no phone number ((123)-999+0000) on this line.

Sample Output:

(123)-456-7890 (123)-555-1212 (123)-999-0000

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

artefact on qualitative accounting research

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago

Question

Are these written ground rules?

Answered: 1 week ago