Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: regexp find last word

by valentin (Abbot)
on Mar 02, 2005 at 21:12 UTC ( [id://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% --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found