Say that I have a string which contains both multiple sets and nesting of parenthesis. I want to extract only the string in the first parenthesis encountered, including whatever nested parenthesis it contains.
For example:
this (is(maybe)) a test (and maybe not)
I want to extract:
is(maybe)
I believe this can be accomplished without the use of regexes, by which I can easily do it.
So my question is how can this be accomplished without regexes?