lua-users home
lua-l archive

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


I am having a bit of trouble comprehending a call to string.gsub in the pm.lua file in thelua-5.2.0 tests. There is a line:

assert(string.gsub("abc", "%w", "%1%0") == "aabbcc")

which works. My problem is that I don't why the substring %1 works and from where it gets its value. As far as I can see there is no captured substring at all. Using %2 generates an error (as I think it should).

Any help would be appreciated.

Robert