Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(#m) and "case" alternation
- X-seq: zsh-workers 33674
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: (#m) and "case" alternation
- Date: Tue, 11 Nov 2014 12:54:23 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=1M0T5pJh5WdA8bzNpLHyiUwj/wERQJvr2dfmB3NcE5c=; b=lH8q5WaAaw9OWQ9FZ7yAGIrN6vYez4wQoknNXUi/GZOx3e3njfsBTv11CiUo7N7Kj9 m4+Jx3mZJQyqQ2gA2CzA1d7yXmEJJXALdepAR+3GJoNZ2yorXiVYtJO+6D+wSNzoRBSK yhatFg2xxFwTBtoD0MGFW87EzyLez8Z1u4nnZflhriutTfFbzqnFAlMeOpeFI3qJKuA7 gh4uVEQgQHrmQEkypspUHzdrjVNwsbQvbUZBeLTfjuqsNMOKcgp4i+ZguwB8YEho89XS wUZdeyt0uY0tvmVMPvHXsVp7lIShuog8/PfHf3atK2rd58PHWng37emXHd3y5zQ1OSwD RZzg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello.
Some unexpected behaviour:
$ case abc in ((#m)a* | b*) echo $MATCH; esac
$ case abc in ((#m)a* | (#m)b*) echo $MATCH; esac
abc
$ case abc in (a* | (#m)b*) echo $MATCH; esac
abc
$ case bcd in ((#m)a* | b*) echo $MATCH; esac
bcd
(#b) is OK:
$ case abc in (#b)(a)* | (#b)(b)*) echo $match; esac
a
$ case bcd in (#b)(a)* | (#b)(b)*) echo $match; esac
b
$ case abc in (#b)(a)* | (#b)(ab)*) echo $match; esac
a
$ case abc in (#b)(ab)* | (#b)(a)*) echo $match; esac
ab
$ case bcd in (#b)(ab)* | (b)*) echo $match; esac
Cheers,
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author