in reply to regex to collect local links in Markdown

I think my first inclination for this sort of problem would be to start with something like
@chunks = split /([\[\]])/;
and build a "state-machine" style parser to go through the chunks in sequence.

(Note that the split is capturing the square brackets, so that they show up as elements in the chunk list.) If your markdown has to do something special with adjacent square brackets, add a "+" just inside the close-paren of the split regex.