Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Stripping HTML tags efficiently

by Crian (Chaplain)
on Dec 10, 2004 at 11:18 UTC ( #413806=note: print w/ replies, xml ) Need Help??


in reply to Stripping HTML tags efficiently

The (or one) problem is, that you have a variable in your regular expression, what is not neccessary in this case. This slows things always down.

Whats about using qr// to compile the expression or just putting the pattern into the RE directly?

while ($target_data=~m/(<[^>]{1,300}>)/gi)

(You don't have to escape < and > btw.)


Comment on Re: Stripping HTML tags efficiently
Download Code
Re^2: Stripping HTML tags efficiently
by agynr (Acolyte) on Dec 10, 2004 at 12:08 UTC
    You are also right.. Thanx for that

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-06 05:08 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 (70 votes), past polls