oalders/html-restrict — pull request #7 by perlpong (2013-01-22 03:58:50+00:00)
Title: Allow attributes to be validated against regexes

Yes, me again. I know this module supposed to be small and simple. But this is a very useful feature, and it does not add much complexity. Please reject if it is too much for you, I am happy to maintain my own fork.

I did not modify the documentation except for adding the following example to the synopsis:

```perl
# you can also specify a regex to be tested against the attribute value
my $hr = HTML::Restrict->new(
rules => {
iframe => [
qw( width height allowfullscreen ),
[ src => qr{^http://www\.youtube\.com} ],
[ frameborder => qr{^(0|1)$} ],
],
img => [
qw( alt ),
[ src => qr{^/my/images$} ],
],
},
);

my $html = '';
my $processed = $hr->process( $html );
# $processed now equals:
```