Thread Regex - Suche nach Tags (7 answers)
Opened by YAPD at 2021-06-01 18:31

 2021-06-01 21:04
#193339 #193339
User since
3870 articles

user image
Dann speicher das Ergebnis der Suche in einem Skalar und übergebe eine Referenz auf diesen an HTML::TokeParser.

perldoc HTML::TokeParser
Code: (dl )
$p = HTML::TokeParser->new( \$document, %opt );

The object constructor argument is either a file name, a file handle object, or the complete document to be parsed. Extra options can be provided as key/value pairs and are processed as documented by the base classes.

If the argument is a plain scalar, then it is taken as the name of a file to be opened and parsed. If the file can't be opened for reading, then the constructor will return undef and $! will tell you why it failed.

If the argument is a reference to a plain scalar, then this scalar is taken to be the literal document to parse. The value of this scalar should not be changed before all tokens have been extracted.

Otherwise the argument is taken to be some object that the HTML::TokeParser can read() from when it needs more data. Typically it will be a filehandle of some kind. The stream will be read() until EOF, but not closed.

Schon versucht?

Doku: CPAN:HTML::TokeParser
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Regex - Suche nach Tags