use strict; use warnings; my $webStr = <other stuff

data-src-hq="image location2"

EOS my @matches = $webStr =~ /data-src-hq="([^"]+)"/g; print join "\n", @matches, ''; #### image location1 image location2