I thought you said in an earlier reply you wanted an array. If you want a hash ref then try this, the while loop matches both values
poj#!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";
In reply to Re^7: regex match unicode characters in ascii string
by poj
in thread regex match unicode characters in ascii string
by 3dbc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |