use strict; use Data::Dumper; my $Incoming = 'uno="one" Blah blah dos="two" * More Noise* tres="three"'; my %att= (PREEXISTING=>"val1", ANOTHER=>"Val2"); $att{ uc $_->[ 0 ] } = $_->[ 1 ] for map[ m[(\w+)="([^"]+)"] ], $Incoming =~ m[\W*(\w+="[^"]+")]ig; print Dumper \%att;