Is it possible to replacing multiple characters and/or words using .replace() in a prompt?

I’m trying to use a prompt to write text to a custom Task field. Since custom Task fields do not like commas, I’m using this [='[?Text]'.replace(/,/g, ';')] to convert comma’s to Semicolons (I’m testing using a Show Message action). That part works as expected.
However, I happened to discover that it also changes the word “is” to “==

Is there a way to use multiple .replace()'s? It appears that only the word is gets converted.

Try and pass the string to a script and return the manipulated text instead of doing it inline in the rule/action.

Thanks @Memo, I was so focused on make the inline method work, I had not considered a script. Thanks!