Normally when you call sed, you can call \1
to reference the submatch number one, i.e.:
<something> | sed "s/<regex>\(<regex>\)<regex>/\1/"
This will just take the middle regex and remove the outer ones.
But what do you do, if you have more then 9 matches? Simply writing \10
doesn't work, because it will be interpreted as take submatch number one and add a zero behind it
.