假设您有以下文本:
yada yada
yada yada 1
;
<Hello.There>yada:EGHKJHKG, Source:QWEKGHGHJGKGHJKGHJKVMVNMVMVMVMVMVMVMBTDFHG, </Hello.There>
yada2
yada3
我只想在Source:
之后和,
之前获取信息。你知道吗
我已经用这个site完成了,并且匹配了源代码值
我的正则表达式是:<Hello.There>.+Source:(.+?),\s*</Hello.There>
我的python代码是:
match = re.match(r'<Hello.There>.+Source:(.+?),\s*</Hello.There>
在这一行之后我一个也没有,有什么想法吗?
(我尝试了更多的regex选项,但没有成功)
re.match
只在字符串的开头匹配。如果不想只在开头匹配,就需要使用re.search
。你知道吗见search() vs. match() from the Python ^{} module documentation 。你知道吗
相关问题 更多 >
编程相关推荐