[Pitch] Extend pattern matching to extract groups from substring matches