perl regex modifiers
Mark Brownell
gizmotron at earthlink.net
Fri Jul 25 17:32:02 EDT 2003
Alex, Dar,
On Friday, July 25, 2003, at 01:48 PM, Alex Rice wrote:
> 1) whitespace matters in regex
> 2) "^" anchors to beginning of the input string-
>
> try put "<perl>(.*)(</perl>)" into regEx
The docs for matchText use this and it works:
matchText(myVar,"^From: (.*) <(.+ at .+)>",userName,userAddress)
When I use "<perl>(.*)(</perl>)" for regEx I get True.
So it works great. If this optimizes in a repeat loop faster than my
offset() repeat loop handler, and I'll bet it does, then I can use it
for single extractions where there is only one possible instance of a
tag-set in the text being searched. If there was a regEx parameter for
after a certain point for matchText(), like there is in offset(), then
I could drop using the offset() handler. I wonder if offSet() has a way
of incorporating regEx into it.
There is something funny about all this. Several years ago someone
tried to tell me about using Perl regEx to do what I was doing. I
didn't think there was a way to do it in Director so I forgot about it.
Now it comes back several years later and it does work better, in Rev.
Thanks,
Mark
More information about the use-livecode
mailing list