I'm parsing Pandoc-markdown files that contain footnotes starting with ^[ and ending with ], some of which contain embedded []. For example:
...
to explain how the feature came to be as it is, so you can use generics more
effectively.^[Angelika Langer's [Java Generics FAQ](
www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html) as well as her other
writings (together with Klaus Kreft) were invaluable during the preparation of
this chapter.]
...
The simple approach of (in Python):
re.compile(r"\^\[.+?\]", flags=re.DOTALL)
Gets stopped at the first ] and thus doesn't capture the whole footnote. Is there a way to pass over the nested [] clause?