Here is the correct sed
command based on your particular input:
cat sample.txt | sed 's/.*\(\/namespace\/media\/.*-sync.xml\).*/\1/g'
In sed, the groups are captured in between \(...\)
but you were using (...)
Also, I have added .*
add the both end of your original regex to discard all other texts.