roRegex

Hi, I need to parse m3u8 file with roRegex component.
For Example we have:

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=303000,CODECS="avc1.4d001f,mp4a.40.2",AUDIO="Audio1",RESOLUTION=320x240
link1
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=728000,CODECS="avc1.4d001f,mp4a.40.2",AUDIO="Audio1",RESOLUTION=640x360
link2
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1137000,CODECS="avc1.4d001f,mp4a.40.2",AUDIO="Audio1",RESOLUTION=640x360
link3

and I need to find all 3 links. I tried this:

function FindEXTX(str) 
	r = CreateObject("roRegex", "#EXT-X-STREAM-INF:.*\n(.*)", "")
	print r.Match(str)
end function

and this prints nothing. But when I test my Regex-expression on https://regex101.com/ it works okay

Try this:


sub Main ()
    m3u8 = ReadAsciiFile ("pkg:/m3u8/test.m3u8")
    for each link in FindEXTX(m3u8)
        print link
    end for
end sub

function FindEXTX(str) as object
    linkList = []
    splitList = CreateObject ("roRegex", "\n", "").Split (str)
    for i = 1 to splitList.Count () - 1 step 2
        linkList.push(splitList [i])
    end for
    return linkList
end function