Why doesn’t `\d` work in regular expressions in sed? [duplicate]

\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

Leave a Comment