* Regexps - what am I doing wrong?
@ 2011-03-07 22:24 Kamil Jońca
2011-03-08 6:13 ` Phil Pennock
0 siblings, 1 reply; 3+ messages in thread
From: Kamil Jońca @ 2011-03-07 22:24 UTC (permalink / raw)
To: zsh-users
Can somebody explain me why in last line zsh responds "yes"?
ZSH_VERSION=4.3.10
--8<---------------cut here---------------start------------->8---
kjonca@alfa:~%q=lll ;if [[ $q =~ ^ERROR.* ]] ; then echo yes ; else echo no ;fi
no
kjonca@alfa:~%q=lll ;if [[ $q =~ ^OK.* ]] ; then echo yes ; else echo no;fi
no
kjonca@alfa:~%q=lll ;if [[ $q =~ ^OK.* || $q =~ ^ERROR.* ]] ; then echo yes ; else echo no ;fi
yes
--8<---------------cut here---------------end--------------->8---
--
http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewskiej-wprowadzenie/
"Nie można wlecieć w trzecie tysiaclecie
na drzwiach od stodoły" - biskup polowy WP Sławoj Leszek Głódź.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Regexps - what am I doing wrong?
2011-03-07 22:24 Regexps - what am I doing wrong? Kamil Jońca
@ 2011-03-08 6:13 ` Phil Pennock
2011-03-08 7:09 ` Kamil Jońca
0 siblings, 1 reply; 3+ messages in thread
From: Phil Pennock @ 2011-03-08 6:13 UTC (permalink / raw)
To: Kamil Jońca; +Cc: zsh-users
On 2011-03-07 at 23:24 +0100, Kamil Jońca wrote:
>
> Can somebody explain me why in last line zsh responds "yes"?
> ZSH_VERSION=4.3.10
Bug, introduced by me when I put in the =~ syntax. Fixed for the 4.3.11
release. =~ corrupted parse state in such a way that you only notice it
when followed by &&/|| -- the sense of the following test would be
inverted. Very embarrassing, sorry. The test suite now checks this.
-Phil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-08 7:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 22:24 Regexps - what am I doing wrong? Kamil Jońca
2011-03-08 6:13 ` Phil Pennock
2011-03-08 7:09 ` Kamil Jońca
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).