Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Alpha number sort (two truer to spec)

by gam3 (Curate)
on Mar 27, 2005 at 20:05 UTC ( #442692=note: print w/replies, xml ) Need Help??


in reply to Re^3: Alpha number sort (two truer to spec)
in thread Alpha number sort

It is always nice to see code that is smaller and faster. Two times faster an 6 times smaller.
      Rate gam3  tye
gam3 243/s   -- -69%
tye  772/s 218%   --
The regex still had one bug: you need a \d in the backtrace to keep it from matching 2.11. on 2.1/1.
qr/((?<!\.)(\d+)\.\d+(?![\.\d])|\d+)/
I would never have thought of using s///g in place of my while loop.
-- gam3
A picture is worth a thousand words, but takes 200K.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-08-01 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (9 votes). Check out past polls.

    Notices?