Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: How can I strip away some nested markup code in html by perl, like <SCRIPT> ?

( #6699=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How can use Perl to strip away some nested HTML markup code, like <SCRIPT> ? contributed by chromatic

Unless you're dealing with very simple HTML (either generated by a program or by a beginner), you might discover that these approaches have limited degrees of success. ender's is the best, as it is least greedy.

For all non-trivial HTML parsing, look to CPAN modules: HTML::Parser and HTML::TokeParser.

Comment on Answer: How can I strip away some nested markup code in html by perl, like <SCRIPT> ?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2015-07-07 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls