in reply to regex help

I’m not sure what your surrounding code looks like, but two thoughts do come to mind.   First If your regex that works 90% of the time fails, can you not simply follow that, in an if..elsif structure, with others that might, until one of them hits?   Second, if you are extracting lots of stuff from a well structured doc, you might be able to use a parser, such as Parse::RecDescent, to describe the surrounding-context from which you want to extract information.