encode metadata as JSON
Match regex for grouping happy