Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: regexp find last word

by valentin (Abbot)
on Mar 02, 2005 at 21:12 UTC ( #436008=note: print w/ replies, xml ) Need Help??


in reply to Re^2: regexp find last word
in thread regexp find last word

Here is what I mensure on my PPC:

use strict; use warnings; use Benchmark 'cmpthese'; cmpthese( -2, { holli => sub { $_ = "fox comes and fox goes into forest"; s/(fox.+)?(fox.+?forest)/${1}the $2/; }, Roy => sub { $_ = "fox comes and fox goes into forest"; s/(?=fox(?:(?!fox).)*forest)/the /; }, ikegami => sub { $_ = "fox comes and fox goes into forest"; s/(fox(?:(?!fox).)*forest)/the $1/; }, borisz => sub { $_ = reverse "fox comes and fox goes into forest"; s/(tserof.*?)xof/${1}xof eht/; $_ = reverse; } } ); __OUTPUT__ Rate holli ikegami Roy borisz holli 62934/s -- -3% -25% -31% ikegami 65121/s 3% -- -23% -29% Roy 84099/s 34% 29% -- -8% borisz 91530/s 45% 41% 9% --


Comment on Re^3: regexp find last word
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-07-13 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (245 votes), past polls