Why doesn't `\d` work in regular expressions in sed?
\d
is a switch not a regular expression macro. If you want to use some predefined "constant" instead of [0-9]
expression just try run this code:
s/[[:digit:]]+//g
There is no such special character group in sed. You will have to use [0-9]
.
In GNU sed, \d
introduces a decimal character code of one to three digits in the range 0-255.
As indicated in this comment.