in reply to Re^2: How to find the outermost pair of square brackets with a regex?
in thread How to find the outermost pair of square brackets with a regex?

I should point out that ikegami's suggestion by itself would surely have worked, but I couldn't get it to for the nuances that I needed, and so I added some possibly unnecessary cruft to account for my needs. I.e., I don't really know why |\n|[^\[\]+])+\] was necessary, but after many hours of trial and error, it was that which made everything (appear to) work.
  • Comment on Re^3: How to find the outermost pair of square brackets with a regex?
  • Download Code