Macro to generate instance of anonymous subclass with methods for matching groups of regex.