提交 34770512 编写于 作者: L laozhang

delete 193 bash

上级 04a65534
#!/bin/bash
# 可用
egrep '^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$' file.txt
grep -E '^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$' file.txt
awk '/^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-([0-9]{4})$/' file.txt
# Mac 不能用
grep -P '^(\d{3}-|\(\d{3}\) )\d{3}-\d{4}$' file.txt
sed -n -r '/^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$/p' file.txt
cat file.txt | grep -P '(^(\d{3})\s|^\d{3}-)\d{3}-\d{4}$'
cat file.txt | grep -E '(^([0-9]{3})\s|^[0-9]{3}-)[0-9]{3}-[0-9]{4}$'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册