lua-users home
lua-l archive

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


> But!  There is this:
> 
> 	%x: (where x is any non-alphanumeric character) represents the
> 	character x.  This is the standard way to escape the magic
> 	characters. Any non-alphanumeric character (including all
> 	punctuations, even the non-magical) can be preceded by a '%' when
> 	used to represent itself in a pattern.
> 
> So to me, that says that '%%' is NOT a class and can therefore be used as
> mentioned.  I wonder what Roberto meant by the example of "[a-%%]".  Perhaps
> a typo?

Where does it say it is not a class? Read the whole story:

  |  The following combinations are allowed in describing a character class:
  |
  |    %x: (where x is any non-alphanumeric character) represents the [...]

It is a class: a unit set, which includes only that character.

-- Roberto