I asked this question to chatGpt, he gave me this regex and example:
let str = '"This is a "test" string with "quotes" in the middle."';
let result = str.replace(/(?<=^|[^"])(")(?=S.*")/g, 'replacement');
console.log(result);
But I still get the first double quotes in the begining of the string replaced
//replacementThis is a replacementtest" string with replacementquotes" in the middle."
I need only the doubles quotes in the middle to be replaced, not in the beginning or the end.