. Given an alphabet with opening and closing parentheses {), (} only, create a regex that validates all strings containing the sub-string (((). Make sure to support your answer with the proper reasoning. 2. Build a regular expression that captures the 10-digit US phone numbers (10 digits excluding the coun- try code, country code is optional), where # means any number from 0 to 9. Make sure to support your answer with the proper reasoning. It is recommended to use # instead of [0-9] for simplicity and you can follow the rules mentioned below as your test cases (this list is not exhaustive). • ########## • ###-###-#### • (###) ###-#### • ###.###-#### • ### ### #### • ###.###.#### • +1 ### ### ####

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
1. Given an alphabet with opening and closing parentheses {), (} only, create a regex that validates all
strings containing the sub-string (((). Make sure to support your answer with the proper reasoning.
2. Build a regular expression that captures the 10-digit US phone numbers (10 digits excluding the coun-
try code, country code is optional), where # means any number from 0 to 9. Make sure to support
your answer with the proper reasoning.
It is recommended to use # instead of [0-9] for simplicity and you can follow the rules mentioned
below as your test cases (this list is not exhaustive).
• ##########
• ###-###-####
• (###) ###-####
• ###.###-####
• ### ### ####
• ###.###.####
• +1 ### ### ####

 
 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT