If you see something like the following error message when you run a sed command:
invalid reference \1 on `s' command's RHS
then it (probably) means that your regex capture group has not been escaped properly.
So, if you are using a command like:
then it needs to be escaped like so:
In other words, round parentheses/brackets need to be escaped while the square brackets do not :|
Hope this helps :)