[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 17 Jul 2015 11:58:25 -0300
> > Debating what notation to use for something that cannot be
> > a character class seems related to exterior-designing the
> > velocipede enclosure :-)
> In the same message he also noted that %f exists even though it is not
> a "set of characters" either.
Sure. Again, this seems to mix syntax with semantics. The manual is
quite clear about what is a character class and what is an item. Whether
something is written '%x' has nothing to do with whether it is a
character class or an item (char classes include '[...]' and '.',
and items include %f and %b).
Only character classes can be used inside [...] combined with other
classes. You cannot use %f (or %b) inside a [...], as you cannot use
^$. That seemed to be the main point for changing the original ^$
symbols. Changing only the syntax (to %i/%e) but not changing their
categories to char classes would make little difference.