Thread Nur tatsächliche Texte aus HTML parsen
(21 answers)
Opened by Nordlicht at 2007-05-09 20:04
@Froschpopo:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #!/usr/bin/perl use strict; use warnings; local $/; my $html = <DATA>; (my $neu = $html) =~ s/<[^>]*>//gs; print $neu; __DATA__ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Frosch Test</title> </head> <body> <div>Die Bedingung <pre>4 < 5 </pre> ist wahr!</div> </body> </html> Ausgabe: Code: (dl
)
1 fral20857@fral20857:~$ perl froschpopo.pl OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |