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:
cdab
Because I get:
\2\1
What am I missing?
Cheers,
- Charles
On 12 Aug 2014, at 11:38 PM, Thierry Douez <[email protected]> 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
http://digital.museografica.com
Mac OSX 10.9.4, LC 6.6.2 Commercial
LC Developer Tools: http://buchwald.ca/developer-tools/
Email Notice: http://wp.me/P3aT4d-33
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode