Valid Phone Numbers

https://leetcode.com/problems/valid-phone-numbers/


# Read from the file file.txt and output all valid phone numbers to stdout.

awk '/^([0-9]{3}-|([0-9]{3}) )[0-9]{3}-[0-9]{4}$/{print $0}' file.txt

原文地址:https://www.cnblogs.com/jzssuanfa/p/6763411.html