perlquestion
JeffR100
I am trying to find a way to use a regular expression to sort through nested parentheses and return everything within them surroundign a perticular element. Basically, I want to extract everything within the minimum matching parentheses surrounding a particular element. For example, I want to be able to input:
<p>
((A,B),C,(D,E)) and the letter C and have the program the program return (A,B),C,(D,E)), but if I enter D, I only want (D,E) returned. Is there a simple way to do this? I have looked at the CPAN modules for matching nested parentheses, but none of them are able to look for a specific string within the parentheses.
<p>
Thank You for your help.
<p>
Jeff