in reply to Regular Expression: Matching arbitrary characters

This works for me:
use strict; use warnings; use Data::Dumper; my $line = 'One animal="ap3!" and another one fish="s4lm%%on" can all be eaten. (So can the bird="sparr0w!$$")'; my %hash; while ($line =~ m/\b(\w+)="([^"]*)"/g) { $hash{$1} = $2; } print Dumper \%hash; __END__ $VAR1 = { 'animal' => 'ap3!', 'bird' => 'sparr0w!$$', 'fish' => 's4lm%%on' };

\w includes digits and underscores, no need to list them separately.