【发布时间】:2021-06-10 11:40:29
【问题描述】:
我希望 grep 一行以字母开头,后跟 5 个数字。
我的方法是 例如
'A12345'
'A123456'
output should be only line starting with Alphabet followed by 5 numbers
ie 'A12345'
My approach : it doesn't work
grep -E '[A-Z]''[0-9]{5}'
【问题讨论】:
-
我想你想要
grep -E "^[A-Z][0-9]{5}$ -
@Sundeep 这些数字在单引号内,我怎样才能用它实现相同的 grep