readdate.lua@dc0c8914ac04
readdate.lua
Sun, 21 Jun 2009 19:12:26 +0100
- author
- Matthew Wild <mwild1@gmail.com>
- date
- Sun, 21 Jun 2009 19:12:26 +0100
- changeset 9
- dc0c8914ac04
- parent 4
-
305e9dd7fc34
- child 10
-
6700d4722be7
- permissions
- -rwxr-xr-x
Return the position of the start and end of the matched text
#!/usr/bin/env lua
local ndp = require "ndp";
local base;
for line in io.lines() do
if line:match("^base:%d+$") then
base = tonumber(line:match("^base:(%d+)$"));
else
local ret = ndp.when(line, base);
print(os.date("%c", ret).." ("..ret..")");
end
end