Q:

How to match this kind of string in Python use re?

I have several strings like these:
unicode 0, <runtime error >,0
unicode 0, <TLOSS error>
unicode 0, <- Attempt to use MSIL code >
unicode 0, <ModuleNameA>

I am trying to use re to match all the string inside "<" ">"
I tried this :
items = line.split()
pattern = r"<.+?>"
match = re.findall(pattern, items[2])

But it seems that space can not be deal with..
Could anyone give me some help?
Thank you!

A:

items[2] contains partial content:
>>> items = line.split()
>>> items[2]
'<runtime'

Just pass the line to the re.findall:
>>> line = 'unicode 0, <runtime error >,0'
>>> re.findall(r'<.+?>', line)
['<runtime error >']

