in reply to Help on multiline regex

I don't think your mapping of input to output is unambiguous.

I would loop over the input and try to match the head-lines and fieldelements of the object-groups.

Then either call specialized subroutines which do the parsing of the following indented lines of the recognized group or raise a warning for an unknown group.

Like this your data will also be evaluated for correctness.

Sorry no code.

Cheers Rolf