I'm trying to obtain multiple tuples from the following 'text' using python findall()
text = '[szur formatter] line 1<?xml version="1.0"?><star>[szur parser] line 2<?xml version="1.0"?><Planet>'
I want to get the following matching patterns from 'text'
Match 1
[szur formatter] line 1
<?xml version="1.0"?><star>
Match 2
[szur parser] line 2
<?xml version="1.0"?><Planet>
I'm trying to do this with findall using this regex
re.findall(r'\[(szur.*?[^<])(<.*>+)', text)
this yields
[('szur formatter] line 1', '<?xml version="1.0"?><star>[szur parser] line 2<?xml version="1.0"?><Planet>')]
How to get the expected results. My regex doesn't yield the second tuple. How do I need to amend my regex to obtain this? Any pointers will be appreciated.