in reply to Re^4: A NOT in regular expressions (no new features?)
in thread A NOT in regular expressions

Alternate solutions. The simplest is to use a minimal match: m/<%.*?%>/s. However you can get by with basic features with something like: m/<%[^%]*(%+[^%>][^%]*)*%+>/. That should, possibly with appropriate syntax adjustments, work in any RE engine worthy of the name.