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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage