while ( $string =~ /(Group|Role)\:\s+([\x00-\x7f]*)/g ){ print "$1 = $2\n"; };