Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: HTML tag search/replace.

by Maclir (Curate)
on Apr 20, 2001 at 07:11 UTC ( [id://74061]=note: print w/replies, xml ) Need Help??


in reply to HTML tag search/replace.

HTML::Parser is your friend. A subset - HTML::TokeParser - may be sufficient. You are correct, Adam, when you identify the source of the difficulty - they there are a variety of ways to code those HTML tags. (as a side issue - XHTML with a much more rigid syntax will make this easier - sort of like "use strict;" for HTML.)

Now, if this is part of a class project, maybe they are wanting to see how you would tackle the problem, as an exercise in analysis and program design. At least HTML::Parser should be a good source of inspiration.

Replies are listed 'Best First'.
Re: Re: HTML tag search/replace.
by mirod (Canon) on Apr 20, 2001 at 11:13 UTC

        
    XHTML ... sort of like "use strict;" for HTML

    You know this is brilliant! It makes perfect sense both for Perl coders trying to understand XML and XHTML and for XMLers learning Perl.

    Saddly it still allows for both ' and " to be used around attributes and has no rule concerning URL's, so they will still be just as hard to parse ;--(

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://74061]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-11-02 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (11 votes). Check out past polls.