hello everybody
this is my first experience with runrev and so far it has been kinda like a roller coaster ride, one moment i'm awestruck , the next moment i'm almost scratching my head uncontrollably.
anyway what is the regex delimiter?
i have this regex matchtext("<h1 ="(.*?)">" ,matchedtext) and i tried \ as the delimiter but i got an error
i'd appreciate help in this
pardon my grammar, i'm in a bit of a hurry.
Regex delimiter
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I know what you mean, Frodo. Many things are amazingly easy then something seemingly simply is confounding.
You're using the correct literal character, "\". This works for me.
This displays
You're using the correct literal character, "\". This works for me.
Code: Select all
on mouseUp
put "<a href=" & quote & "http://forums.runrev.com" & quote & ">RunRev Forum</a>" into tUrl
get matchText ( tUrl, "<a href=\"(.*?)\">", tMatchedText)
put tMatchedText
end mouseUp
Code: Select all
http://forums.runrev.com
-
- Posts: 2
- Joined: Wed Aug 19, 2009 3:26 pm
Thanks a lot dablock, your code worked.dablock wrote:I know what you mean, Frodo. Many things are amazingly easy then something seemingly simply is confounding.
You're using the correct literal character, "". This works for me.This displaysCode: Select all
on mouseUp put "<a href=" & quote & "http://forums.runrev.com" & quote & ">RunRev Forum</a>" into tUrl get matchText ( tUrl, "<a href="(.*?)">", tMatchedText) put tMatchedText end mouseUp
Code: Select all
http://forums.runrev.com
i had not added the command 'Get' before matchtext and hence the error

just one last question,
is there a way to get all the matches of a pattern into an array or something and then iterate over the them and print it?
I tried doing so but the variable got only the first match!
Also, Is there some sort of foreign function interface to c/c++ or some other language in runrev? I'm thinking of creating a pcre compatible regex package with named captures and all that if there is an ffi interface. The present regex library falls short on many counts in my opinion.