如题:
同样的正则表达式(简单的筛选邮件地址),为什么grep不行,awk可以
[redhat@localhost scripts]$ echo "12305@qq.com" | grep '^([a-zA-Z0-9]+)@([a-zA-Z0-9]+).([a-zA-Z]{2,5})$'
[redhat@localhost scripts]$
[redhat@localhost scripts]$
[redhat@localhost scripts]$ echo "12305@qq.com" |awk --re-interval '/^([a-zA-Z0-9]+)@([a-zA-Z0-9])+.([a-zA-Z]{2,5})$/'
12305@qq.com
[redhat@localhost scripts]$