Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [Bug] S-flag imposes non-greedy match where it shouldn't



On Sat, Dec 28, 2019 at 11:05 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> I think that many examples in the man pages are like that – they don't
> go the obvious path of just demonstrating the usage but instead, they
> cover some edge case

Usually the examples in the manual page are derived from some usage in
a completion function or the like, or from a "how do you accomplish
X?" question on one of the mailing lists that led to the addition of
the feature in question.  Consequently they tend to have been drawn
from unusual situations and never updated once a more obvious/common
usage develops.

> > > +if not the tt([^X]) part, as despite the tt(%%) specifies a greedy
> > > +match, the substring matching works by trying matches from right to
> > > +left and stops at a first valid match.
> >
> > There are some grammatical errors here (e.g., s/(?<=specif)ies/ying/)
>
> I think that grammar is correct here. Did you maybe misread the sentence?

In American English it would be more common to say "despite X
specifying Y" or "despite that X specifies Y" -- it's not exactly
wrong to omit the word "that" but it's unusual.  Sometimes one would
even go so far as "despite the fact that X specifies Y".   In the
first case "despite" modifies "specifying", in the second case
"despite" modifies the entire condition "X specifies Y" and "that" is
needed to distinguish that "despite" isn't directly modifying "X"
(exactly the way I put "that" after "distinguish" in this sentence).



Messages sorted by: Reverse Date, Date, Thread, Author