Regular Expression part 2

Ken Ray kray at sonsothunder.com
Wed Aug 9 11:12:28 EDT 2006


On 8/9/06 9:13 AM, "Ton Kuypers" <tkuypers at dmp-int.com> wrote:

> I have found a regular Expression which does exactly what I need and
> it works in BBedit but not in RR...
> What am I doing wrong?

Well, first of all, RR uses PCRE which is a slightly different parsing
engine than what is used by BBEdit. So things like "\1" for placeholders
aren't supported (see http://www.pcre.org/man.txt for more info).

Also, I think that you will need to use a newline match (\n) instead of your
"cr" in:

>      put "^(.*)(" & cr & "\1)+$" into vSearch

And finally, you may want to test for the match first with matchText before
you use replaceText.

But also keep in mind that replaceText is limited by the fact that it can't
work on extracted values, so you may be barking up the wrong tree.

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list