Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Do you know where your variables are?
 
PerlMonks  

Re: Re: How do I tighten this with map?

by mikeB (Friar)
on Oct 16, 2001 at 16:08 UTC ( [id://119169]=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 Re: How do I tighten this with map?
in thread How do I tighten this with map?

Just curious why you replaced \w{3} with \w\w\w.
  • Comment on Re: Re: How do I tighten this with map?

Replies are listed 'Best First'.
Re3: How do I tighten this with map?
by Hofmator (Curate) on Oct 17, 2001 at 12:13 UTC

    That's a little speed optimisation, with /\w{3}/ the regex engine sees the {} construct and has to start counting. If you write it out it's just three single characters in a row, so no counting => quicker.

    Of course, this could be optimised by the regex compiler but that wasn't the case at the time of writing of Mastering Regular Expressions. At least this is where I got this from. As japhy is more up to date on this I assume he has checked that this optimisation hasn't been done in the meantime.

    -- Hofmator

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://119169]
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.