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

Re: PATCH: Update the description of S flag in the completion



On Tue, 2019-12-03 at 06:16 +0100, Sebastian Gniazdowski wrote:
> On Mon, 2 Dec 2019 at 01:46, Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> > 
> > 
> > On that occasion, isn't this a bug?:
> > 
> > ❯ str="ab##c#d"; print ${(S)str##\#}
> > ab#c#d
> > ❯ str="ab##c#d"; print ${(S)str##\##}
> > ab##c#d
> > 
> > Why no match at all in the second case?
> Any update on this? It would be good that the rarely-used flags are reliable.
> 

You've got an expression which can match an empty string which you're
also telling to match a substring so it can match an empty string
anywhere.  The order in which it tries to match will be crucial so this
is not a useful thing to attempt.  What are you actually trying to do?

pws



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