lua-users home
lua-l archive

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

On Wed, Jul 06, 2011 at 10:20:51AM +0200, Philippe Lhoste wrote:
> On 05/07/2011 18:07, Roberto Ierusalimschy wrote:
> > Both '\[' and '\]' were legal in 5.0.
> >
> > A common case is '\?'.
> Keeping these sequences as is (no special meaning) would be good to express classical 
> regular expressions in a simple string...
> Not sure if it is a must have, as we have literal/long strings.

It would be simpler if the rules for '\' in a string were similar
to those of '%' in a pattern.  I.e. 

> %x: (where x is any non-alphanumeric character) represents the character x.
> This is the standard way to escape the magic characters. Any punctuation
> character (even the non magic) can be preceded by a '%' when used to
> represent itself in a pattern. 

Of course, 'simpler' does not necessarily imply 'better'.