I need to replace all substrings except those which are in curly braces. For example, from such string:
let str = 'some text one some text one some text {one} some text';
I need to get the following string:
str = 'some text two some text two some text {one} some text';
I tried this:
console.log(str.replace(/one(?!\{one\})/g, 'two'));
but got this:
some text two some text two some text {two} some text
How to do it?