I am trying to replace an extended regular expression using sed on macOS 10.14.3 (18D109). If I do not use the extended regular expression then the inline flag works otherwise it does not update the file, however without the -i flag it prints the correct result to the console. Why does it happen, How could I fix it?
$ echo "foo" > foo.txt
$ sed -i -E 's/fo{1,}/123123/g' ./foo.txt
Nothing happens.
$ sed -E 's/fo{1,}/123123/g' ./foo.txt
123123