mainmanc
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2010
01:33 PM
Re: roRegex question
Nice one! Clever use of the Replace.
Thanks again for your help. So far this seems like a good developer community. 😄
Cheers.
Thanks again for your help. So far this seems like a good developer community. 😄
Cheers.
mainmanc
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2010
03:05 PM
Re: roRegex question
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.
Cheers.
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.
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016
04:58 AM
Re: roRegex question
Hello, I'm trying to return the numbers only after text= (1234) from the below line;
whatever?text=1234","name":"whatever
CreateObject ("roRegex", ".*?text=([^,]+),(.*)", "s")
Gives me 1234"
*,(.*)", "s")
Gives me 0
What is wrong? Thank you
whatever?text=1234","name":"whatever
CreateObject ("roRegex", ".*?text=([^,]+),(.*)", "s")
Gives me 1234"
*,(.*)", "s")
Gives me 0
What is wrong? Thank you
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016
05:06 AM
Re: roRegex question
@matrixieBiz - your question is already here https://forums.roku.com/viewtopic.php?f ... 82#p544813
Please do not pollute this 6-year old thread with it.
Please do not pollute this 6-year old thread with it.
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016
05:53 AM
Re: roRegex question
Doing a search brought up this tread also so thought I would post here as well to get more exposure.
I can't find good documentation on what all the "*,(.*)", "s")" does
I can't find good documentation on what all the "*,(.*)", "s")" does

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016
08:52 AM
Re: roRegex question
Posting the same question in two places just makes it harder for people to find answers in the future. Polluting the forum with unnecessary posts to get your own questions "more exposure" in not appropriate. I am closing this thread.
--Mark
--Mark
- « Previous
-
- 1
- 2
- Next »