Standard Library

Charles E Buchwald charles at
Wed Aug 13 10:45:03 CEST 2014

Hi Thierry,

OK, well, cool.... But can you help me understand?

Do you mean if I put this in the message box, making the replacements you suggest:
    put replaceText("abcd","(ab)(cd)","\2\1")

I should get:

Because I get:

What am I missing?

- Charles

On 12 Aug 2014, at 11:38 PM, Thierry Douez <th.douez at> wrote:

> Sorry to be a bit more precise, but actually back references *are*
> implemented. You can use them in the pattern matching, as:
>  " (.)\1"
> I let the reader find what's for :)
> A regex engine needs 2 input: a text and a pattern matching
> and it returns true or false plus a list (generic word)
> of index if any captures. That's it. Everything else is *not* part
> of the regex engine.
> That said, implementing back references in the replacement text
> is and only is the responsability of Livecode engine! (see below)
>>> Example:
>>> I would expect to be able to do this in the message box:
>>> put replaceText("abcd","(ab)(cd)","$2$1")
>>> and get this:
>>> "cdab"
> Well, change $1 $2 by \1 and \2 and it will be less Perlish
> plus this syntax is already in use.

Charles E. Buchwald
CEO/Director General
Museografica Digital

Mac OSX 10.9.4, LC 6.6.2 Commercial

LC Developer Tools:

Email Notice:

More information about the use-livecode mailing list