Match Common Telephone Number
Write a regular expression that matches common telephone number formats entered by end-users. The regular expression should match the following:
  • 408-555-5259
  • 650.555.5251
  • 555-5252
  • (612) 555-8252
  • 212-555-5292
  • +14155555352
Additionally, it should not match:
  • 408-555-525
  • 612-000-5252

Answer

Answers are hidden from search engines.
regular-expressions language=java coding