lua-users home
lua-l archive

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


On Jan 21, 2008 2:34 PM, Duck <duck@roaming.ath.cx> wrote:

> This seemed a good sort of "small is beautiful" match for Lua, so I have
> written a Lua module, consisting of a single Lua file, to use this data
> for IP-to-country lookup.
>
> http://software77.net/geo/webnet77.lua.gz
>
> It's licensed under a "What You Will" licence.


Hey, this is really handy, thanks for posting!

I started tweaking the code a bit to better suit my needs,
and I did stumble upon one possible bug:

> local a,b,c,d = ip:match('(%d+).(%d+).(%d+).(%d+)')

I think that should that be:

local a,b,c,d = ip:match('(%d+)%.(%d+)%.(%d+)%.(%d+)')


Regards,
 - Jeff