need some regular expression help

Chris chrispatton at gmail.com
Sat Oct 7 17:30:09 EDT 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