[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 19 Jul 2015 10:25:29 -0300
> 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.