in reply to Multiline RegExp. A Better Way?
While it might be overkill in this case, as an aside I would mention Parse::RecDescent which is an excellent tool to use for “complicated” inputs that exhibit a predictable structure. It has a bit of a learning curve associated with it, but it really “moves the freight” in the right situations. I’ve asked it to do things that were deserving of overtime and maybe a disability claim, and it just did ’em.