Note this string replacement is not anchored (right?) which can end up biting you badly (depending on circumstances of course).
Edit: It turns out that Bash does substitutions in the middle of strings using the ${string/substring/replacement} and ${string//substring/replacement} syntax, for more details see https://tldp.org/LDP/abs/html/string-manipulation.html