Help for this page
s{(<[^>]+>)|%([^%]+)%}{ $1 || $replace{$2} // "%$2%" }ge;
my @matches = grep defined, $data =~ m{<[^>]+>|%([^%]+)%}g