I'm trying to learn how to use regex effectively to find and replace characters/strings.
For example, I would like to replace all the "p" (lower case) with "*" in the string "Peter Piper picked a peck of pickled peppers".
Using RegexReplace(Text.Text,"p","","*") only replaces the first p with *. Shouldn't this expression match every "p" in the string?
When I run RegexMatchCount(Text.Text,"p",""), again I only get 1 match, when I would expect to get 7.
I found a workaround where I add the condition "While RegexMatchCount(Text.Text,"p","")!=0" and it will run until there are no more "p" to change, but this way seems like a bit of a hack to me.
I am also familiar with the alternative option using the replace expression: replace(Text.Text,"p","*"), but I feel like Regex could give me much more control in more complex scenarios, such as case sensitivity for this example.
References:
Construct 2 System Expressions https://www.scirra.com/manual/126/system-expressions
IndieKiwi Regex Tutorial https://www.scirra.com/tutorials/1337/e ... t-2/page-1
Capx:
https://www.dropbox.com/s/wd8dlg2hbx3vb ... .capx?dl=0