my $content = "\n" . 'type1="scientific" type2="technical"'; #### my ($type1) = $content =~ /type1="([^"]+)"/; #### my $is_sceintific = $content =~ /type[0-9]*="scientific"/;