Q:

Replace string starting with specific char, until specific char

Globally in a file, I want to find all occurrences of strings starting with .git#v and replace the part of the string from the v until the next " with another string. 
So, f.e.  if I had migrations.git#v1.1.1", - I want to find it by .git#v and replace v1.1.1 with develop.  The point is that the version number will vary for the different occurrences, that's why I need to rely on finding these pieces by the .git#v part. 
I've got this so far:
sed -i -- 's/.git#v/.git#develop/g' package.json

but I know this is quite not enough because it will only replace the whole .git#v with develop. 

A:

echo 'migrations.git#v1.1.1"' |sed -r 's/\.git#v[^"]+"/\.git#develop/g'
migrations.git#develop

IF you do not wish to use -r : + sign needs to be taken care of. 
sed 's/\.git#v[^"]\+"/\.git#develop/g'
migrations.git#develop

awk solution , using gsub :
echo 'migrations.git#v1.1.1"' |awk '{gsub(/.git#v[^"]+"/,".git#develop")}1'
migrations.git#develop

