To use regex syntax in sed, you have to put in \ before (, {, etc. to use them as special characters. For example:
~ > echo 123 | sed 's/[0-9]{2}/x/'
123
vs.
~ > echo 123 | sed 's/[0-9]\{2\}/x/'
x3
This is the reverse of what I’m used to. Is there any way to make characters have special meanings by default?
Try: