著者: ph10 日付: To: Pcre-dev CC: ND 題目: Re: [pcre-dev] Partial match at end of subject
On Mon, 15 Jul 2019, I wrote:
> However, there does exist the PCRE2_NOTEOL option. At the moment, this
> is applied only to the $ meta character, not \z or \Z. Perhaps it
> should.
Or perhaps an entirely new option PCRE2_NOTEOS (not end of subject)
should be invented, to stop \z ever matching.
My point about partial matching meaning "may be incomplete" is still
true. Partial matching was not invented originally for multi-segement
matching, but for dynamically checking input. For example, if a user is
typing an 8-digit number, as each character is received it can be added
to the input and then the input can be matched to ^\d{8}\z with a
partial option. Later, other features were added to help multi-segment
matching.
Also, "partial hard" means "return a partial match if it is found before
a complete match". There is no requirement for any particular ordering.
Therefore, for a pattern such as /\z/ a complete match may be found
and returned without any partial consideration.