From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 722 invoked from network); 2 Jul 2001 06:13:35 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Jul 2001 06:13:35 -0000 Received: (qmail 29025 invoked by alias); 2 Jul 2001 06:12:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15196 Received: (qmail 29014 invoked from network); 2 Jul 2001 06:12:36 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: "Peter Stephenson" , "Zsh hackers list" Subject: RE: bracket expressions and POSIX Date: Mon, 2 Jul 2001 10:13:22 +0400 Message-ID: <000301c102be$19047990$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20010630190039.59EB714286@pwstephenson.fsnet.co.uk> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006 Importance: Normal > > 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). 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