Nick Cleaton > HTML-StripScripts-Regex > HTML::StripScripts::Regex

Download:
HTML-StripScripts-Regex-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

HTML::StripScripts::Regex - XSS filter using a regular expression

VERSION ^

Version 0.02

SYNOPSIS ^

This class subclasses HTML::StripScripts, and adds an input method based on a regular expression. See HTML::StripScripts.

  use HTML::StripScripts::Regex;

  my $hss = HTML::StripScripts::Regex->new({ Context => 'Inline' });

  $hss->input("<i>hello, world!</i>");

  print $hss->filtered_document;

Using a regular expression to parse HTML is error prone and inefficient for large documents. If HTML::Parser is available then HTML::StripScripts::Parser should be used in preference to this module.

METHODS ^

This subclass adds the following methods to those of HTML::StripScripts.

input ( TEXT )

Parses an HTML document and runs it through the filter. TEXT must be the entire HTML document to be filtered, as a single flat string.

SUBCLASSING ^

The HTML::StripScripts::Regex class is subclassable, in exactly the same way as HMTL::StripScripts. See "SUBCLASSING" in HTML::StripScripts for details.

SEE ALSO ^

HTML::StripScripts, HTML::StripScripts::Parser, HTML::Parser

AUTHOR ^

Nick Cleaton, <nick at cleaton dot net>

COPYRIGHT & LICENSE ^

Copyright 2009 Nick Cleaton, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: