need some regular expression help

Chris chrispatton at gmail.com
Sat Oct 7 23:30:09 CEST 2006


I need a pattern that  matches a string that has the same number of '('
as ')':
findall( compile('...'), '42^((2x+2)sin(x)) + (log(2)/log(5))' ) = [
'((2x+2)sin(x))', '(log(2)/log(5))' ]
Can anybody help me out?

Thanks for any help!




More information about the Python-list mailing list