zsh-workers
 help / color / mirror / code / Atom feed
* (#m) and "case" alternation
@ 2014-11-11 12:54 Stephane Chazelas
  2014-11-11 13:23 ` Mikael Magnusson
  2014-11-11 15:44 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Stephane Chazelas @ 2014-11-11 12:54 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-11 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11 12:54 (#m) and "case" alternation Stephane Chazelas
2014-11-11 13:23 ` Mikael Magnusson
2014-11-11 15:44 ` Bart Schaefer
2014-11-11 17:43   ` Stephane Chazelas
2014-11-11 17:59     ` Peter Stephenson

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).