Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: bracket expressions and POSIX
- X-seq: zsh-workers 15196
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxxxxxxxxxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: RE: bracket expressions and POSIX
- Date: Mon, 2 Jul 2001 10:13:22 +0400
- Importance: Normal
- In-reply-to: <20010630190039.59EB714286@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
>
> Clint Adams wrote:
> > POSIX says that \ loses its special meaning within a bracket
> > expression for pattern matching
What gave you that idea? I would be highly surprised if POSIX had different
rules as XPG and SUS; and according to SUS the following still matches abc:
a["\b"]c
Actually, SUS explicitly speaks about both quoting (when parsed by shell)
and escaping (when pattern is interpreted).
<http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_013>
Note, that patterns in shell are *based* on regular expressions but not
identical (that probably has confused you).
(anyone remember off
> the top of their head how to match both a `]' and a `-'?).
If a bracket expression must specify both - and ], the ] must be placed
first (after the ^, if any) and the - last within the bracket expression.
Where zsh really violates POSIX:
==
Since each asterisk matches zero or more occurrences, the patterns a*b and
a**b have identical functionality
==
Another point is using collating elements, ranges etc ... anything that has
to deal with locale.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author