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

Re: Stripping HTML tags efficiently

by Crian (Curate)
on Dec 10, 2004 at 06:18 UTC ( [id://413806]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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.)

Replies are listed 'Best First'.
Re^2: Stripping HTML tags efficiently
by agynr (Acolyte) on Dec 10, 2004 at 07:08 UTC
    You are also right.. Thanx for that

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://413806]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.