Here is an attempt at a
MatchAll function for any other developer needing this functionality.
😮 I'm new to BRS, so feel free to educate if I could be doing anything better.
Thanks to
TheEndless for the help and code.
Function MatchAll (pattern As String, subject As String, flags As String) As Object
regex = CreateObject("roRegex", pattern, flags)
response = Left(subject, Len(subject))
values = []
matches = regex.Match( response )
iLoop = 0
While matches.Count() > 1
values.Push( matches[ 1 ] )
' remove this instance, so we can get the next match
response = regex.Replace( response, "" )
matches = regex.Match( response )
' if we've looped more than 500 times, then we're
' probably stuck, so exit
iLoop = iLoop + 1
If iLoop > 500 Then
Exit While
End If
End While
Return values
End Function
Cheers.