I tried to use sd to append something to the input, like echo "abc" | sd '(.*)' '${1}def'. However, that returns two lines, once the correct output and once only the replacement def.
Even echo "abc" | sd '(.*)' 'def' fails with the same pattern. echo "abc" | sd '(.*)' '${1}', however, works.