my $type = ""; if ($msgString =~ m/Typ\s*:\s*(\w+)/i) { $type = $1; $type =~ s/\r\n//g; }#if print "start" . $type . "end";