How do I remove words from a string if they appear in an array?

Ok so after hitting my head against a wall for 2 hours, I learned two things.

  1. the replace() does not perform well with regex until you fully save changes in the scenario.

  2. the pattern you provided isn’t working for me with both (‘g’ and ‘i’) included at once within the replace() function. If I remove one of them, the function works as you’d expect (minus the respect feature of the flag removed). But the moment I add the second flag back in, the whole pattern ceases to work at all. It doesn’t produce an error, it just fails to match anything.

I did a little come across your old post here that seems to indicate there is some limitation behind the scenes, but also states you can use both those flags together.

Any thoughts?