I have a .js file built by an optimizer which is long 71581 bytes all on one single line. I need to replace a couple of occurrences of values in it (VUE_APP_API_HOST:"host") and in theory the correct command should be:
sed -i "s|VUE_APP_API_HOST:\".*?\"|VUE_APP_API_HOST:\"otherhost\"|g" file.js
The regex, if tried in a regex editor, works perfectly: https://regex101.com/r/iblY6i/3 If run in the above sed command, the substitution happens on the first occurrence but after that some other text disappear. No idea what I'm doing wrong. Tried on both MacOs and Linux.