function to extract text from a pile of returned text

not needed

' 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

ifString.split() can get you started:

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"
]

not needed

What are you calling it with?

If you can guarantee that each in text=, is a sequence of digits, you can use this regex:

re = CreateObject ("roRegex", ".*?text=(\d+),(.*)", "s")

See below

not needed

re = CreateObject ("roRegex", ".*?text=(\d+)[^,]*,(.*)", "s")

should allow a sequence of digits then strip off anything else before the next comma.

not needed

not needed

not needed

not needed

The last regex I gave you will only return digits. If you’re getting a quote character at the end, then you didn’t cut and paste correctly.Double-check it’s exactly what I suggested. If it still doesn’t work then paste the exact code you’re using and an exact data string you’re passing that isn’t working.

“matrixebiz” wrote:

I can’t find good documentation on what all the “,(.)”, “s”)" does
You won’t find any Roku-specific documentation regarding the syntax of regular expressions, as they are not a Roku-specific feature. Regular expressions are implemented in many languages on many platforms. The different implementations have much in common, so any resource on learning regular expressions in general can be helpful, as long as you are aware that Roku implements Perl-compatible regular expressions (PCRE).

They are, however, an advanced programming feature, albeit an extremely useful one, and as such the learning curve can be quite steep.

If you really want to learn regular expressions, you could:

read the documentation: https://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124

take on online course: https://www.google.com/#q=how+to+learn+regular+expressions

Corrected

Like I said, you didn’t cut and paste the last suggestion I gave you. Try again. Post #9.

not needed

I give up. You’ll have to figure this out on your own.

You’ve posted neither the exact data string that you’re trying to parse, nor the exact code you’re using based on my last suggestion. If you can’t follow simple instructions then no amount of help from others will do you any good.

“belltown” wrote:
I give up. You’ll have to figure this out on your own.

You’ve posted neither the exact data string that you’re trying to parse, nor the exact code you’re using based on my last suggestion. If you can’t follow simple instructions then no amount of help from others will do you any good.
Ok, thanks anyway, the data string I sent you in a PM and the code in your last suggestion returned a 0 so maybe I’m just not understanding what you need. Sorry about that. i’ll just be up all night again trying to get rid of that " :disappointed_face: Oh, well at least you got me in the right direction.