I need to replace all exclamation marks in a sentence and I can do it for the first exclamation mark but I don’t understand how to make it repeat for all the words/spaces in a random string without looping.
Sentence = "! word! hello cat! you are !! the one"
regex:replace(Sentence, "!", "" );
This returns ” word! hello cat! you are !! the one”.
So is this possible without looping?
Here’s a formal answer (moving it out from the comments).
Simply use the global modifier in the regular expression replace routine: