Help for this page
my %good = map +($_ => 1), qw{ pre strong }; my $string = "xxx<pre>xxx<www>xxx<strong>xxx"; while ($string =~ m{<(\w+)>}g) { warn "bad word '$1'" unless $good{$1}; }
print "ok\n" if $string =~ m{ ^ ( [^<] | < (?: pre | strong ) > )* $ }x;