grep
's default mode is (iirc) POSIX regex, and d
is pcre. You can either pass -P
to gnu grep, for perl-like regexps, or use [[:digit:]]
instead of d
.
daenyth@Bragi ~ $ echo 1 | grep -P 'd'
1
daenyth@Bragi ~ $ echo 1 | grep '[[:digit:]]'
1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…