I wanted to learn to use regex, since I think it can be a real useful tool, so I begin with something basic, however, something feels wrong to me.
Right now I have a Text that displays at the start of layout the result of this expression:
RegexMatchCount("Create Create cReate", "Create", "i")
It returns 1, I'd expect it to return 3, but it doesn't and I don't understand why, I mean, Create is located twice, and cReate should also be counted too due to the "i" flag.
Can someone help me understand?
Develop games in your browser. Powerful, performant & highly capable.
I haven't really played with reg expressions in construct but it sounds like its doing a test() and not a match()
The first returns true/false where the second would return an array with the matched text
Try with the g flag, to make the search global.
adding the "g" flag solved it, thanks ^both of you for your help