m[ <% # Opening delimiter. (?: [^%]+ # Things that can't start one. | % (?!>) # % that aren't part of a closer )* # As many non-closing-delims as you like. %> # Closing delimiter. ]x