Advertisement
193. Valid Phone Numbers
UnknownView on LeetCode
193.sh
Shell
# Read from the file file.txt and output all valid phone numbers to stdout.
grep -e "^[0-9]\{3\}\-[0-9]\{3\}\-[0-9]\{4\}$" -e "^([0-9]\{3\}) [0-9]\{3\}\-[0-9]\{4\}$" file.txtAdvertisement
Was this solution helpful?