2
爲什麼這個正則表達式不工作?正則表達式之間的一切,Python
import re
i="<wx._controls.Button; proxy of <Swig Object of type 'wxButton *' at 0x2d040b0> >"
m = re.match("controls(.*)[;]", i)
if m:
print m.group(1)
它什麼都沒有返回。我試圖讓所有事情都處於中間,「控制」和「;」 該解決方案適用於其他測試用例,但不適用於此測試用例。
閱讀本文[Python的re.search和re.match有什麼區別?](http://stackoverflow.com/questions/180986/what-is-the-difference-between-pythons-re-search-和重賽) – RanRag