#!perl use strict; use HTML::Entities; use Data::Dump 'pp'; my $string = "Group: Group Name▼▼Role: Role Name"; $string = decode_entities($string); my $href={}; while ( $string =~ /(Group|Role)\:\s+([\x00-\x7f]*)/g ){ $href->{$1} = $2; }; pp $href; print "Role = $href->{'Role'}\n"; print "Group= $href->{'Group'}\n";