Validate US Phone Numbers with Regular Expression

Problem: Validate US Phone Numbers with a Regular Expression

Given a string s, determine whether it is a valid US phone number. It must contain exactly 10 digits (no country code 1). T...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: