Leetcode/bash/193.sh

3 lines
139 B
Bash
Raw Normal View History

2024-06-21 00:36:40 +00:00
# Read from the file file.txt and output all valid phone numbers to stdout.
grep -P "^\(\d{3}\) \d{3}-\d{4}$|^\d{3}-\d{3}-\d{4}$" file.txt