I was trying to replace dates in a huge file using sed. I tried : sed -ie 's/2014-[0-9]{2}-[0-9]{2}/2014-05-07/g' testHowever, nothing happened at all, my file test is not modified. Do you know what I am missing here ?Thank you very much.
Using sed to perform substitutions in a file
sed;replace
By default, sed uses basic regular expressions.  In BRE, {, }, (, ) act like ordinary characters.  As such, you'd need to escape the { and }:sed -i 's/2014-[0-9]\{2\}-[0-9]\{2\}/2014-05-07/g' testYou would not need to escape those if using extended regular expressions, i.e.sed -r -i 's/2014-[0-9]{2}-[0-9]{2}/2014-05-07/g' testThe -r option for sed denotes ERE:   -r, --regexp-extended          use extended regular expressions in the script.Moreover, using -e is redundant in your example.