Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 184 Bytes

valid-phone-numbers.md

File metadata and controls

7 lines (6 loc) · 184 Bytes

Solution

# Read from the file file.txt and output all valid phone numbers to stdout.
cat file.txt | grep -P '^\(\d\d\d\) \d\d\d-\d\d\d\d$|^\d\d\d-\d\d\d-\d\d\d\d$'