The input file is machine generated so the content and format is well defined. The regex is loose.
The output config file could be hand edited and so the regex is a lot more restrictive. Comments are ignored.
I am hoping to be shown a better way of doing this.