regular expression for getting content between parentheses

Rajanikanth Jammalamadaka rajanikanth at gmail.com
Fri May 8 01:51:14 CEST 2009


Hi

I have a text file as follows:

testName = (
 someParam = value1
 anotherParam = (value2, value3)
)

how do I write a regular expression to get all the contents of the
file which are between the first and last parentheses.

In this case,  I want:

 someParam = value1
 anotherParam = (value2, value3)

Thanks,

Raj



More information about the Python-list mailing list