Valid Phone Numbers
来源:互联网 发布:新加坡网络电视直播 编辑:程序博客网 时间:2024/05/16 07:47
题目描述:
Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.
You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)
You may also assume each line in the text file must not contain leading or trailing white spaces.
For example, assume that file.txt has the following content:
Your script should output the following valid phone numbers:
0 0
- [leetcode]Valid Phone Numbers
- Leetcode: Valid Phone Numbers
- Valid Phone Numbers
- Valid Phone Numbers
- Valid Phone Numbers
- Valid Phone Numbers
- 193 - Valid Phone Numbers
- leetcode193. Valid Phone Numbers
- 193. Valid Phone Numbers
- 193. Valid Phone Numbers
- 193. Valid Phone Numbers
- 193. Valid Phone Numbers。
- leetcode-193 Valid Phone Numbers
- LeetCode 193 Valid Phone Numbers
- 【Leetcode Shell】Valid Phone Numbers
- leetcode 193. Valid Phone Numbers
- Leetcode 193. Valid Phone Numbers
- 193. Valid Phone Numbers#1
- heheh
- 科研小白漫谈方法论
- Oracle10g数据库用户创建及数据导入导出操作
- Android_文件读写
- Spring事务配置
- Valid Phone Numbers
- 详细介绍C++中的友元函数和友元类
- 数据挖掘顶级期刊会议
- 下载时的中文名文件乱码
- 使用nginx搭建http代理服务器
- 产品经理的职责
- chrome 解除右键禁用
- 循环Map
- 火狐浏览器(Firefox)打开EBS form的设置方法