From: Chet Ramey <chet.ramey@case.edu>
To: Peter Stephenson <p.stephenson@samsung.com>,
Martijn Dekker <martijn@inlv.org>,
zsh-workers@zsh.org
Cc: chet.ramey@case.edu
Subject: Re: 'case' pattern matching bug with bracket expressions
Date: Thu, 14 May 2015 17:23:42 -0400 [thread overview]
Message-ID: <5555125E.5070901@case.edu> (raw)
In-Reply-To: <20150514154238.0e547ff0@pwslap01u.europe.root.pri>
On 5/14/15 10:42 AM, Peter Stephenson wrote:
> This is the pattern:
> '[' introducing bracketed expression
> '] | *[!a-z' characters inside
> ']' end of bracketed expression
> '*' wildcard.
>
> so it's a set including the character a followed by anything, and hence
> matches.
>
> I'm not really sure we *can* resolve this unambiguously the way you
> want. Is there something that forbids us from interpreting the pattern
> that way?
Look at the Posix grammar. A case pattern list is a sequence of one
or more WORDs separated by (zero or more) `|'s. WORDs are delimited by
metacharacters and cannot contain unquoted blanks. The `[]' is a
separate WORD delimited by a space.
The rules governing how the pattern is treated only come into play
after the command is parsed.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
next prev parent reply other threads:[~2015-05-14 21:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 13:14 Martijn Dekker
2015-05-14 13:50 ` [BUG] " Martijn Dekker
2015-05-14 14:42 ` Peter Stephenson
2015-05-14 15:47 ` Martijn Dekker
2015-05-14 15:55 ` Peter Stephenson
2015-05-14 17:30 ` Bart Schaefer
2015-05-15 0:05 ` Chet Ramey
2015-05-14 23:51 ` Chet Ramey
2015-05-15 8:38 ` Peter Stephenson
2015-05-15 20:48 ` Peter Stephenson
2015-05-15 21:48 ` Bart Schaefer
2015-05-14 16:17 ` Peter Stephenson
2015-05-14 17:07 ` Martijn Dekker
2015-05-14 17:43 ` Peter Stephenson
2015-05-15 0:09 ` Chet Ramey
2015-05-14 23:59 ` Chet Ramey
2015-05-14 21:23 ` Chet Ramey [this message]
2015-05-14 23:45 ` Chet Ramey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5555125E.5070901@case.edu \
--to=chet.ramey@case.edu \
--cc=martijn@inlv.org \
--cc=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).