I want to process a string like this (a (b) c) and I want to match the inner (b) first before processing the outer parens. However, this code doesn't work:
>>> x='(a(b)c)'
>>> re.search(r"\((.*?)\)", x).group(1)
'a(b'
Is there any way to ask Python to find a minimal match (ie, b) rather than the longer match a(b?