正则表达式返回括号之间的文本 [英] Regular expression to return text between parenthesis
本文介绍了正则表达式返回括号之间的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
u'abcde(date=\'2/xc2/xb2\',time=\'/case/test.png\')'
我需要的是括号内的内容.
All I need is the contents inside the parenthesis.
推荐答案
如果你的问题真的这么简单,你就不需要正则表达式:
If your problem is really just this simple, you don't need regex:
s[s.find("(")+1:s.find(")")]
这篇关于正则表达式返回括号之间的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文