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

Re: strange glob expansion



Peter Stephenson wrote:

> By the way, does anyone want a globbing flag to turn on extended glob?
> e.g. (#x)foo and (#X)foo would compile pattern foo with extended glob
> on or off.

That would then be an exception in that it is recognised even if
extendedglob is not set, right?

Hm, dunno. May make things hard to read if you are used to using
extendedglob, I think. Although it sounds like something that may be
useful, although I can't come up with an example.


However, this reminded me...

We had this discussion about allowing back-references. Personally I
don't think that just storing the matched portions in some special
array is the best way -- what if I'm really interested in the indexes
(beginning/end of matched part)?

So how about a set of globbing flags that turn on collecting
back-references, say what information we want and give the name of an
array where that information is stored? Something like `(#mparts)...'
to store the matched parts in an array named `parts', `(#pbegs:ends)...'
to store the begin-positions in an array `begs' and the end-positions
in an array `ends'. Or something like that.

I don't know enough about the matching code to know if this `turn-on-
back-references-only-when-needed' is possible and easy enough to
implement and if the effect on the normal, non-collecting processing
is small enough (in terms of execution speed).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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