Re: Patterns: Why are anchors not character classes?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2015年7月17日 14:21:37 +0200
2015年07月17日 10:12 GMT+02:00 John Hind <john.hind@zen.co.uk>:
> 2015年7月16日 18:24:43 -0400 Jonathan Goble <jcgoble3@gmail.com>
>
>>So just use something else (though I don't know what to suggest). The
>>main point is to use letters instead of punctuation to avoid breaking
>>existing code.
>
> On reflection, Jonathan, I agree completely. Maybe '%i' and '%e' for
> "initial" and "end" - but since few of the codes have any discernible
> mnemonic value, that is probably a secondary consideration!
> Incidentally, this has the additional benefit of reducing "^" to one
> unambiguous meaning and eliminating "$" as a special character.
> But whether to actually deprecate them is a choice.
The last few posts have completely ignored Roberto's comment.
2015年07月16日 14:53 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> `[set]` is hardcoded to match one character of the subject or
>> to report no match.
>
> This is not hardcoded only in the code. It is "hardcoded" in the
> definition of a character class:
>
> Lua 5.3 Reference Manual, 6.4.1:
> A character class is used to represent a set of characters.
>
> Set of characters cannot contain empty strings...
Debating what notation to use for something that cannot be
a character class seems related to exterior-designing the
velocipede enclosure :-)