Regular expression to return text between parenthesis

user469652 picture user469652 · Feb 4, 2011 · Viewed 185k times · Source
u'abcde(date=\'2/xc2/xb2\',time=\'/case/test.png\')'

All I need is the contents inside the parenthesis.

Answer

tkerwin picture tkerwin · Feb 4, 2011

If your problem is really just this simple, you don't need regex:

s[s.find("(")+1:s.find(")")]