Charles E Buchwald
charles at buchwald.ca
Tue Aug 12 20:51:32 CEST 2014
Yes, but just having a more complete implementation of PCRE regex would make a big difference.
For example, LC's regex does not include back references.
Having the ability to use (PCRE compliant) back references would, I believe, in many case, eliminate the need for that array of matches.
> The dictionary says "LiveCode implements regular expressions compatible with the PCRE library." Without back references the LC implementation is a rather limited subset of that library.
> I would expect to be able to do this in the message box:
> put replaceText("abcd","(ab)(cd)","$2$1")
> and get this:
> Instead I have to do this:
> if matchText("abcd","(ab)(cd)",var1,var2) then put var2 & var1
> But this is a trivial example. If either my string to search or my pattern is slightly more complex, then what would be a trivial task with full PCRE compliant regex becomes comparatively complicated in LC.
On 12 Aug 2014, at 3:56 AM, John Craig <john at splash21.com> wrote:
> Agree - matchText and matchChunk would both benefit from the ability to specify an array to fill with matches - we don't always know exactly how many will appear ..
> On 12/08/2014 02:12, Peter Haworth wrote:
>> I've always kinda thought the return variable parm to matchText was a little strange as it relies on you knowing how many matches will be found in advance. It would be great if the returned variable could be an array keyed by the numeric match number, alike the variables you can supply to the some of the database functions.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
Charles E. Buchwald
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
More information about the use-livecode