I have a similar but different problem. Say I have a file with a list of records, all have at least one field "FOO:" "BAR" and "BAZ" are optional fields. Each value may be multi line and the new lines are't consistent between variables e.g.
FOO: Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et dolore
BAR: 2012
BAZ: 1234-567-890
FOO: test
BAZ: 0987-654-321
FOO: test2
BAR: 2014
I'm having a hard time getting my head around regexes, and help would be appreciated.