my @matches = grep defined, $data =~ m{<[^>]+>|%([^%]+)%}g