Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

(#m) and "case" alternation



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