我有文字的一些作品是这样的:Python的正则表达式捕获文“:”和“”(点后面的空格)
GAEDS030, GAEDS031, GAEDS032 : Problem reported in a https://twikiae.myweb.es
/twiki/bin/view/Grid/ActFeb2011 previous entry has been observed in another disk server
that was under a stress test (gaeds034). We have contacted technical service at LSI and
they have suggested us to update to a brand new firmware (!FE9X 4.10.00.021). After a new
test period if seems that raid card does not reset under heavy load as in the past. So it
has been upgraded every card of this branch (gaeds030-gaeds034)
他们中有些人没有冒号。
现在,我使用这个正则表达式后第一:
和前第一.
re.search(':([^\.]*)(\.)*', description)
,这捕获文本时它没有:
re.search('((.*)(?!\.))', description)
正如你所看到的,我有URL,IP等问题,所以我想在:
之后的.
(点后跟空格)之前捕获文本。
我试过白色否定组,但它不允许将它们用于组。
您的预期产出是? – 2014-10-01 07:07:45
实际输出为:'在https:// twikiae中报告的问题,但我希望获得'在https://twikiae.myweb.es /twiki/bin/view/Grid/ActFeb2011之前报告的问题在另一台正在压力测试(gaeds034)下的磁盘服务器中观察到入口 – 2014-10-01 07:12:17