Is \d not supported by grep's basic expressions?
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
Try this $ echo 'this 1 2 3' | grep '[0-9]\+'