Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: Un-patch: new pattern matching code
- X-seq: zsh-workers 7394
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: RE: Un-patch: new pattern matching code
- Date: Sat, 7 Aug 1999 13:02:16 +0400
- Importance: Normal
- In-reply-to: <9908061547.AA37737@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
>
> The other cpp definition is BACKREFERENCES, which enables backreferencing
> of parentheses in patterns like sed and perl do. I haven't enabled it
> because I don't know what, if anything, I'm going to do with it.
This may prove useful for ${.../...} case at least. More general use depends on
scope of these references. If e.g. the result of last pattern mathing is
available (much like in Perl) as, say, ``pattern'' array, than it may be even
more useful in case like
if [[ ... == ... ]]
foo="$pattern[1]-$pattern[3]"
that would completely eliminate need of expr. (I am not sure, that there is easy
way in Zsh to extract matched subpattern currently)
/andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author