' Return array of <item> strings from string containing occurrences of: text=<item>,
'
Function extractTextList (data As String) As Object
list = []
re = CreateObject ("roRegex", ".*?text=([^,]+),(.*)", "s")
ma = re.Match (data)
While ma.Count () > 2
list.Push (ma [1])
ma = re.Match (ma [2])
End While
Return list
End Function
Brightscript Debugger> ? "blah, blah, blah, blah, text=1234, blah, blah, text=1234, blah, blah, blah, blah".split("text=")
<Component: roArray> =
[
"blah, blah, blah, blah, "
"1234, blah, blah, "
"1234, blah, blah, blah, blah"
]
re = CreateObject ("roRegex", ".*?text=(\d+),(.*)", "s")
re = CreateObject ("roRegex", ".*?text=(\d+)[^,]*,(.*)", "s")