lib/DNS/Vi.pm
changeset 100 e7f889e69790
parent 97 50f2f0edcf25
child 103 04685427a35b
equal deleted inserted replaced
99:664b775b56bd 100:e7f889e69790
    31 
    31 
    32     $_ = '';
    32     $_ = '';
    33     foreach (@lines) {
    33     foreach (@lines) {
    34 	# simplificated comment remover
    34 	# simplificated comment remover
    35 	# after the comment character no '"' is allowed!
    35 	# after the comment character no '"' is allowed!
    36         s{^\s*;.*$}{};		  # strip comment lines
    36 #        s{^\s*;.*$}{};		  # strip comment lines
    37 	s{\s*;[^"]*$}{};	  # strip trailing comments
    37 #	s{\s*;[^"]*$}{};	  # strip trailing comments
       
    38 
       
    39 	# see https://regex101.com/r/cG6fK3/2
       
    40  	s{\s*(?:;)(?:(?:[^"]|"[^"]*")*$)}{};
    38         state $line;
    41         state $line;
    39         if (my $range = /(.*)\(\s*$/ .. /(.*)\)\s*/) {
    42         if (my $range = /(.*)\(\s*$/ .. /(.*)\)\s*/) {
    40             $line .= defined $1 ? $1 : $_;
    43             $line .= defined $1 ? $1 : $_;
    41             next unless $range =~ /E0$/;
    44             next unless $range =~ /E0$/;
    42         }
    45         }