in reply to search for matching parentheses
It would be easy with a regex:
my $str = "param1(info, blah) param2(new info, more blah)"; while ($str =~ /(\S+\(.*?\))/g) { my $pattern = $1; print "Found pattern '$pattern'\n"; }
except that when you're adding to the equation the ability to detect nested parenthetical groupings (ie. parentheses within parentheses):
Parameter2(new info(DN), blah)
then it makes things a lot more complex.
So you may have to rethink whether that's part of the requirement or not, and if so, how you want to parse it.
|
|---|