I've already looked at the following:
Escape a string for a sed replace pattern
Is it possible to escape regex metacharacters reliably with sed
They give absolutely no easy to understand answer.
version=1.2.3
sed -i -z -e 's/"version": "[A-Za-z0-9_.-]*"/"version": "$(version)"/' package.json
I'm trying to use a variable in a replace regular expression in a file. I don't have to use sed per say, as long as it works on macs and linux dists I'm ok with it.