c. Write a BNF grammar and a regular expression that describes the structure of US telephone numbers, which can either be (000)000-0000 or 000-0000, where x is a digit from 0 to 9. Grammar Regular expression

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
c. Write a BNF grammar and a regular expression that describes the
structure of US telephone numbers, which can either be (000)000-0000 or
000-0000, where x is a digit from 0 to 9.
Grammar
Regular expression
Transcribed Image Text:c. Write a BNF grammar and a regular expression that describes the structure of US telephone numbers, which can either be (000)000-0000 or 000-0000, where x is a digit from 0 to 9. Grammar Regular expression
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning