MatchText and PCRE
Mark Greenberg
markgreenberg at cox.net
Tue Jul 19 20:14:38 EDT 2005
David,
I am by no means an advanced programmer in Rev, but I have been using
Regex alot lately. This is what I have discovered in my use of Regex
in Rev:
On Monday, July 18, 2005, at 06:25 PM, David Vaughan wrote:
> Is it greedy? If so, is that reversible and how?
* and + are greedy. The lazy (not greedy) versions are *? and +?.
These do work in Rev as expected.
>
> Does the dot match newline? If not, can it be made to do so?
Dot does not match a new line. Perl specification has (?s) as the mode
modifier that makes dot match a newline, but I was not able to get that
to work correctly in Rev. I gave up and found another solution to my
particular situation.
>
> Does a pattern like ".*" match empty? If not, can it be changed?
Yes.
>
> Is case-sensitivity in matchText affected by Rev's caseSensitive
> property? It appears not. Is case sensitivity settable?
Case sensitivity is not affected by the Rev setting, and you place (i?)
at the beginning of your Regex string to turn off case sensitivity,
(?-i) to turn it on. (I haven't tried the latter.)
I highly recommend the book Mastering Regular Expressions by Jeffrey E.
F. Friedl. There are a bunch more obscure codes that work in the Rev
flavor of Regex.
Mark Greenberg
More information about the use-livecode
mailing list