我有几个类似的字符串:
unicode 0, <runtime error >,0
unicode 0, <TLOSS error>
unicode 0, <- Attempt to use MSIL code >
unicode 0, <ModuleNameA>
我正在尝试使用re来匹配“<;”“>;”中的所有字符串
我试过这个:
items = line.split()
pattern = r"<.+?>"
match = re.findall(pattern, items[2])
但似乎空间是无法处理的。。你知道吗
谁能帮我一下吗?你知道吗
谢谢你!你知道吗
items[2]
包含部分内容:只需将
line
传递给re.findall
:只是不要把它们分开,像这样用绳子
如果你只想要里面的字符串,你可以这样做
相关问题 更多 >
编程相关推荐