[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: gsub problem?
- From: Manfred Lotz <manfred.lotz@...>
- Date: Sat, 5 Nov 2005 22:31:13 +0100
Hi all,
I encountered a strange problem using gsub:
Say I have function like this:
function log(date,msg)
pat = "%date %str"
ostr = string.gsub(pat,"%%date",date)
ostr= string.gsub(ostr,"%%str",msg)
print(ostr)
end
Now log(os.date(),"strange string %4 is this")
yields:
stdin:4: invalid capture index
stack traceback:
[C]: in function `gsub'
stdin:4: in function `log'
stdin:1: in main chunk
[C]: ?
What do I do wrong?
--
Manfred