in reply to How do I avoid regex engine bumping along inside an atomic pattern?

I'm not really following your problem, but here are some ideas that may be of use to you.

Since you are parsing strings with multiple newline characters, perhaps the /m modifier would be of use. Search for //m in perlretut.

You may have special characters in your regex, so you may need to use the \Q..\E escape sequences.

Perhaps the CPAN module, Hardware::Vhdl::Lexer, does something similar to what you are looking for. I have not used it, but poking through the source code may give you clues if/how the author parses VHDL comments.