lua-users home
lua-l archive

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


On Wed, 27 Jun 2007, Mauro Iazzi wrote:

> The backslash is still considered escape at string constructor level.
> It is discarded before it arrives to gsub. Then gsub does not even
> know it was there and interprets the ^ as negating next char (it needs
> at least one). Anytime you want a backslash in a string just insert it
> twice.

As an aside, I have to say that the idea of using % for escaping in Lua
patterns is a pretty neat way of reducing the multi-layer escape problem
that's common in other languages (such as emacs lisp and exim configs).

Tony.
-- 
f.a.n.finch  <dot@dotat.at>  http://dotat.at/
SOUTHEAST ICELAND: NORTH 6 OR 7, OCCASIONALLY GALE 8 AT FIRST. ROUGH OR VERY
ROUGH. SHOWERS. GOOD.