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

Re: Another minor =~ glitch



On 2017-04-07 Fr 10:33:20-0700, Bart Schaefer wrote:
> torch% set -x
> torch% [[ foo =~ .* ]]
> +Src/zsh:2> [[ foo -regex-match .* ]]
> torch% [[ foo -regex-match .* ]]
> +Src/zsh:3> [[zsh: unknown condition: -regex-match
>  ]]
> torch% 

Regression observed since my Zsh update
from bb6c08b51a079870 to fc1fedda954e1d10.

Similarly using operator “-pcre-match” fails,
using operator “=~” instead works around:

syst% zmodload zsh/pcre
syst% zmodload -F -l zsh/pcre
+b:pcre_compile
+b:pcre_match
+b:pcre_study
+C:pcre-match
syst% setopt RE_MATCH_PCRE XTRACE
syst% [[ "A" -pcre-match "(?i)a" ]]
[[zsh: unknown condition: -pcre-match
 ]]
syst% [[ "A" =~ "(?i)a" ]]  && print y
[[ "A" -pcre-match "(?i)a" ]]
print y
y
syst%



-- 
Roland Eggner



Messages sorted by: Reverse Date, Date, Thread, Author