in reply to Re: How to speed up multiple regex in a loop for a big data?
in thread How to speed up multiple regex in a loop for a big data?

I thought \b \b pairs will do the trick since they will match word boundaries. FYI, my mapping file has no redundant entries. Please correct me if I am wrong
  • Comment on Re^2: How to speed up multiple regex in a loop for a big data?

Replies are listed 'Best First'.
Re^3: How to speed up multiple regex in a loop for a big data?
by Corion (Patriarch) on May 25, 2006 at 09:51 UTC

    You're correct with the \b word boundaries. The problem case I am thinking of is the following renaming setup:

    %mapper = ( foo => 'zap', zap => 'foo', )

    Here, foo will be replaced by "zap" in your loop and then again by "foo". But if that can't happen, all you'll gain with the large regex is speed ;)

      Theritically, you are right. However, new names will have suffixes and prefixes around old variable names in my case. It won't happen. Thanks though.