2013/7/29 Geoff Canyon <gcan...@gmail.com>

> On Mon, Jul 29, 2013 at 12:14 PM, Peter Haworth <p...@lcsql.com> wrote:
>
> > Personally, I'd use the regex that Thierry posted a couple of days back.
> >  No recursion involved and one line of code does the job.
> >
>
>
> If you're talking about:
>
> matchChunk(mystring,"(\([^)]*\)).*",tstart,tEnd)
>
> That will return 1,4 for the string "((()))"
>


​which is the correct answer.

This one line of code is a straight answer to the 1st post of this thread
where no-one speaks about nested parentheses!

If you change the rules afterwards, then it's another story and
different answers..

I like this sentence picked up from Mark's pointer:

    "I would go with something that works on sane things
         than weep about not being universally perfect :-)  "

Best,

Thierry

------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to