Using Python, I need to parse a file with the following structure:
((Lorem) ipsum dolor sit amet)
(consectetur adipiscing elit.)(Etiam
suscipit
pulvinar congue.)
((Vivamus) eu faucibus enim.)
The result needs to be a list with the contents of everything in the brackets, i.e.,
[
'(Lorem) ipsum dolor sit amet',
'consectetur adipiscing elit.',
'Etiam\nsuscipit\npulvinar congue.',
'(Vivamus) eu faucibus enim.'
]
Since the brackets can be nested, perhaps regex is not the tool I'm looking for.
Any hints?