Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

Minor bug: roRegex.split() loses empty strings at the end

What subject says - there is some issue with regex.split(), where it will lose the last few substrings that are empty. fw5 and 3.

Here is example - note each string contains 2 colons and thus should be split in 3 substrings and output should've been all 3s:
BrightScript Debugger> re = createObject("roRegex", ":", "")
BrightScript Debugger> for each line in ["1:2:3", ":2:3", "1::3", "1:2:", "1::", "::"]: ? re.split(line).count(): end for
3
3
3
2
1
0
0 Kudos