Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Regular expression matching

by matija (Priest)
on Mar 17, 2004 at 10:03 UTC ( [id://337271]=note: print w/replies, xml ) Need Help??


in reply to Regular expression matching

I don't think you want to do that with one regular expression. If I had to do it with regular expressions, I would first match text inside paragraphs, and then discard all the paragraphs that had <b> in them.

However, parsing HTML with regular expressions is an exercise in frustration. What happens if you have a newline in the tag? What happens if you have one in the paragraph? By the time you've resolved all those problems, you've written the better part of a HTML parser.

You'd be much better off using HTML::Parser, or HTML::TokeParser::Simple.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 06:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found