Hi All, I am trying to come up with a way to scan strings and locate the matching end bracket to the first parent bracket. The difficult part is that there may be many levels of nested brackets within and/or adjacent to the bracket pair of interest. I am not as familiar with perl regular expressions but after doing some searching seems like it may be one potential path to take? Or some tedious do-looping? Note, the first character of the string will always be the parent bracket of interest. Additionally there will always be an even number of { and }. For example, have: data have;
length HAVE $50.;
input HAVE $;
datalines;
{}
{{}{}{}{}{}}
{{}{}{}{}{{}}}{}
{{}{{{}}}{}{}{{}}}{}{{}}
;run; Here I have manually bold the matching end bracket of interest for clarity: {} {{}{}{}{}{}} {{}{}{}{}{{}}}{} {{}{{{}}}{}{}{{}}}{}{{}} Want: 2; 12; 14; 18; Thank you
... View more