use strict; use warnings; use Test::More tests => 2; my $in = "NOTE;ENCODING=QUOTED-PRINTABLE:=0AAddress:=0A=0Aor. Soroca=0ARepublic of Moldova=0A=0A=0A=0A Footwear. =Children's footwear. Lady's footwear."; my $want_key = 'NOTE;ENCODING=QUOTED-PRINTABLE'; my $want_value = "=0AAddress:=0A=0Aor. Soroca=0ARepublic of Moldova=0A=0A=0A=0A Footwear. =Children's footwear. Lady's footwear."; $in =~ /^([^:]+):(.*)/; is $1, $want_key, 'Key matches'; is $2, $want_value, 'Value matches';