lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Jun 3, 2008, at 7:04 PM, Andrew Wilson wrote:

While trying to do a nice natural sorting style example for Lua based
on site http://www.davekoelle.com/alphanum.html site, I wasn't verify
satisfied with my example,
does anyone have a better method of splitting a string into table of
strings and numbers, than my chunkString function below. I know I'm
missing some simple string.gmatch way of doing it.


FWIW, here is another implementation of the same algorithm:

http://dev.alt.textdrive.com/browser/HTTP/NaturalComparator.lua

Based on Andre Bogus implementation of David Koelle's Alphanum algorithm:

http://www.davekoelle.com/files/alphanum.lua

--
PA.
http://alt.textdrive.com/nanoki/