Help for this page

Select Code to Download


  1. or download this
    $data =~ s{(<a\s(?:[^>](?!href))*href\s*)(&(&[^;]+;)?(?:.(?!\3))+(?:\3
    +)?)([^>]+>)}
     {$1.decode_entities($2).$4}gsei;
    
  2. or download this
    <p class="foo" name="bar">
    <p name="bar" CLASS="ovid has no class">
    <p NAME="bar" class="ovid has no class">
    <p name="bar" class="ovid has no class">
    
  3. or download this
    package HTML::Token;
    
    ...
            return $tag;
        }
    }
    
  4. or download this
    my $html = <<END_HTML;
    <h1>This is a test</h1>
    ...
        push @tokens => HTML::Token->new($token);
    }
    push @tokens => (qw[* . *]); # make the (p) tag zero or more, followed
    + by anything
    
  5. or download this
    use Token::Regex;
    my $regex = Token::Regex->new('HTML::Token');
    $regex->parse(\@tokens);
    
  6. or download this
    my $tokens = html_tokens(<<END_HTML);
    <h1>This is html</h1>
    ...
        }
        return \@tokens;
    }