[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: unrecognized escape sequences
- From: pj@...
- Date: Sat, 16 Oct 2010 16:52:54 +1000
> 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 firstname.lastname@example.org (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