![](https://secure.gravatar.com/avatar/cedc4d83943006afe3994fb0a0455f82.jpg?s=120&d=mm&r=g)
On Thu, Apr 03 2008, Edd Barrett wrote:
Just a way of isolating each of the marco's values that cvs defines. How about:
---8<--- \definecvskeyword[cvsdate][D/M/Y]{$Date$}% will be expanded upon commit to something like $Date: 1999/12/23 01:59:22 $ \starttext Last Updated: \cvskeyword[cvsdate] \stoptext ---8<---
would produce: Last Updated: 1999/12/23 01:59:22
Hello Edd, Perhaps like this: % engine=luatex \startluacode thirddata = thirddata or { } -- write the replacement string -- p: pattern -- r: replacement pattern -- s: subject function thirddata.replace(p, r, s) s = string.gsub(s, "^.-" .. p .. ".-$", r) tex.print(s) end \stopluacode \def\definereplacement{\doquadrupleargument\dodefinereplacement} \def\dodefinereplacement[#1][#2][#3][#4]{\expandafter \def\csname #1\endcsname{\ctxlua{thirddata.replace("#2", "#3", "#4")}}} \definereplacement[cvsdate] [(\%d+)/(\%d+)/(\%d+)] [\%3.\%2.\%1] [$Date: 1999/12/23 01:59:22 $] \definereplacement[cvstime] [(\%d+):(\%d+):(\%d+)] [\%1h \%2m \%3s] [$Date: 1999/12/23 01:59:22 $] \definereplacement[cvsfile] [: (.+),] [\\type{\%1}] [$RCSfile: keyword.html,v $] \starttext File: \cvsfile, last Updated: \cvsdate\ at \cvstime \stoptext Cheers, Peter -- http://pmrb.free.fr/contact/