Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Issue with ${var#(*_)(#cN,M)}
- X-seq: zsh-workers 36895
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Issue with ${var#(*_)(#cN,M)}
- Date: Mon, 19 Oct 2015 10:33:16 +0100
- 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=WHOTqlEioRcjQy6brXjlDKBkAQ6C8LX5bw9HIeUhv8I=; b=Ypvs9jILj1ly2eRBt8Ish/gJhmWLNNVgRgahwbzClLzjn/5YMF7ysibkGkliw2GS04 0YwF2rWxERdUXuQoUzjyBlyUKL47Uym5+k2P4EImze36uH9+p0IwFZ1svxvT3O1TGBBi ie1AhBSV67NLZgfehfXFH1eBtm9Oy77nqgZuXTpT5RnhtJkT5MWtBjcI5MzIFqcKbR0+ FjFpfD31OFepf/p4yzZuk8yutKGwiFUwFqUsZGQnllUss9QLvdqVLTav+XToZul73F+i 5V9+dZQzrbFsbqlUAKB2cU7Dcf8ICsRp2RZUIcK2Xa6kTUy0RSN8sKhnmfu+q/Wn6EHk iDug==
- 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
Unless I'm missing something, this looks like a bug:
~$ a='1_2_3_4_5_6'
~$ echo ${a#(*_)(#c1)}
2_3_4_5_6 #OK
~$ echo ${a#(*_)(#c2)}
2_3_4_5_6
~$ echo ${a#(*_)(#c3)}
3_4_5_6
~$ echo ${a#(*_)(#c4)}
4_5_6
~$ echo ${a#(*_)(#c5)}
4_5_6
~$ echo ${a#(*_)(#c6)}
3_4_5_6
~$ echo ${a#(*_)(#c7)}
4_5_6
~$ echo ${a%(_*)(#c1)}
1_2_3_4_5
~$ echo ${a%(_*)(#c2)}
1_2_3_4_5_6
~$ echo ${a%(_*)(#c3)}
1_2_3_4_5_6
~$ echo ${a%(_*)(#c4)}
1_2_3_4
~$ echo ${(S)a/(*_)(#c1)/+}
+2_3_4_5_6
~$ echo ${(S)a/(*_)(#c2)/+}
+2_3_4_5_6
~$ echo ${(S)a/(*_)(#c3)/+}
+3_4_5_6
These are OK:
~$ echo ${a#(?_)(#c1)}
2_3_4_5_6
~$ echo ${a#(?_)(#c2)}
3_4_5_6
~$ echo ${a#(?_)(#c3)}
4_5_6
~$ echo ${a#([^_]#_)(#c1)}
2_3_4_5_6
~$ echo ${a#([^_]#_)(#c2)}
3_4_5_6
~$ echo ${a#([^_]#_)(#c3)}
4_5_6
zsh 5.0.2 (x86_64-pc-linux-gnu) and zsh 5.1.1 (x86_64-debian-linux-gnu)
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author