The documentation of splittext states that if a regular expression is used as the delimiter, any capturing groups in the expression will be included in the list, in order. It seems that the actual behaviour is that these group matches are replaced by the match of the whole regex instead.
Numbered Steps to Reproduce Problem:
1.) Call splittext on a string with a regex delimiter which contains at least one capturing group.
Code Snippet (if applicable) to Reproduce Problem:
world.log << json_encode(splittext("XabXabX", regex("a((b))")))
Expected Results:
["X","b","b","X","b","b","X"]
Actual Results:
["X","ab","ab","X","ab","ab","X"]
Does the problem occur:
Every time? Or how often?Every time.
In other games?N/A
In other user accounts?Yes.
On other computers?Yes.
When does the problem NOT occur?
It seems to occur always.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
I haven't found a version without this bug but I admit I only checked a few (513.1513 does have this bug).
Workarounds: