umdreamer / leetcodeproblems

Solutions for LeetCode OJ
3 stars 9 forks source link

2023.6.5 Problem: 193. Valid Phone Numbers #31

Closed umdreamer closed 1 year ago

umdreamer commented 1 year ago
  1. Valid Phone Numbers Problem Link

Given a text file file.txt that contains a 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.

Example:

Assume that file.txt has the following content:

987-123-4567
123 456 7890
(123) 456-7890

Your script should output the following valid phone numbers:

987-123-4567
(123) 456-7890
ZWJ2212061008 commented 1 year ago

image

yeyuxq commented 1 year ago

image

zyhzxy99 commented 1 year ago

4VLX@Q% 5DUH%86PH2 CQQF

tangyexi commented 1 year ago
屏幕截图 2023-06-05 155836
liu-si-han commented 1 year ago
image
sjh397 commented 1 year ago

image

zhjingyan commented 1 year ago

image

daowuwu commented 1 year ago

E5FD$NI~9QE@4)4ENI H_8D

PinkyLame commented 1 year ago

image

cuixiao02 commented 1 year ago
截屏2023-06-05 16 03 13
mafanjia commented 1 year ago

2

zxm-1235 commented 1 year ago

image

foxbou commented 1 year ago
image
bedauern commented 1 year ago
Snipaste_2023-06-05_17-16-07
huangyumei1 commented 1 year ago

QQ图片20230605175624

syr2212061031 commented 1 year ago

AY08R DN1999WT5Y UPEB

12baoxingyu-6 commented 1 year ago
image
686xiaozhang commented 1 year ago

QQ截图20230605202758

FXL1006 commented 1 year ago
image
Lggg1234 commented 1 year ago

屏幕截图 2023-06-05 115542

24zlx commented 1 year ago

联想截图_20230605204240

123lrb commented 1 year ago

SW5_W_L346SQY `6R~HCE$4

liuhuanyu6 commented 1 year ago

image

gusuning commented 1 year ago
屏幕截图 2023-06-05 205438
1125766961 commented 1 year ago

image

promisewith7 commented 1 year ago

image

xkqwww commented 1 year ago

无标题

wangshiqi7 commented 1 year ago
截屏2023-06-05 21 27 13
naqianqpg commented 1 year ago

7U(MN`$GQ9LU 7P4DC4~J5X

htywan commented 1 year ago

4

xiaolu2002 commented 1 year ago

image

shylieisme commented 1 year ago

O{BYQ M4RFAAFX{2YN)`E84