in reply to Re: Stuck with RegEx
in thread Stuck with RegEx (Parsing whois output)

Does this not print all the values for key2 even if they are in a different section that comes after {section2}?
So you need to reset the $flag variable as soon as you come to the next section.
si_lence