Finding matched parentheses
Geoff Canyon
gcanyon at gmail.com
Fri Jul 26 09:36:00 EDT 2013
You have to account for the nesting of parens, something like:
((()))
Sent from my iPad
On Jul 26, 2013, at 8:17 AM, "Peter M. Brigham" <pmbrig at gmail.com> wrote:
> If you want a more general solution, you could use offsets(a,str) along with offsets(b,str) and look at all the pairs, with item i of offsets(b,str) being index of the closing paren for the open paren at item i of offsets(a,str). Presuming that there are no unmatched parens in str, the latter should be greater than the former for each i.
More information about the use-livecode
mailing list