lua-users home
lua-l archive

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


Hi,

> A similar thing might be said about unrecognized pattern
> characters (e.g. "%e").  I didn't see any instances of that,
> but it's hard so say whether a given string is a pattern without
> doing a dynamic analysis.  Presently, the Lua 5.1 implementation
> treats "%e" as "e", but this behavior seems undefined.

It says in PiL 2nd ed p.181:

  The Magic characters are
    ( ) . % + - * ? [ ] ^ &

  You can use the escape "%" not only for the magic characters,
  but for all other non-alphanumeric characters.
  When in doubt, play safe and put an escape.

Regards,  Peter Billam

http://www.pjb.com.au       pj@pjb.com.au      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2