in reply to use return in regex => allowed or side effects ?
The AnonyMonk's suggestion to "construct the regex from your defs" is discussed in haukex's very nice article Building Regex Alternations Dynamically.
Give a man a fish: <%-{-{-{-<