Page 2 of 2

Re: Simple MatchChunk question

Posted: Wed Nov 24, 2021 5:10 pm
by kaveh1000
This one can be done without regex, but at times it can get very complicated and far easier with regex.

And a rant here that a major shortcoming of LiveCode is that it can search for regex but it cannot replace regex. A gap that has been filled with SunnYrex by @thierry. Works great.

Re: Simple MatchChunk question

Posted: Thu Nov 25, 2021 6:36 pm
by jacque
I may be misunderstanding but is replaceText what you need?

Re: Simple MatchChunk question

Posted: Thu Nov 25, 2021 6:40 pm
by kaveh1000
Hi Jacque

Here I am just trying to find the offset (start and end) of a piece of text (represented by a regular expression). I am not trying to replace it. replacetext will replace the found chunk with something else that I define.

Oh, if you are referring to the last note about no replace option in LiveCode, normally regex can replace a piece of text that is found using replacement strings e.g. \1, \2. This is totally missing in LiveCode. I can give you an example if you like.

Re: Simple MatchChunk question

Posted: Fri Nov 26, 2021 6:38 pm
by jacque
I see now, you're talking about back references. I've missed that too.