From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 486 invoked by alias); 3 Jan 2013 13:20:55 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17531 Received: (qmail 17288 invoked from network); 3 Jan 2013 13:20:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: rahul Cc: zsh-users@zsh.org Subject: Re: case insensitive string match In-Reply-To: (rahul's message of "Thu, 3 Jan 2013 18:00:04 +0530") References: <87zk0qzg1u.fsf@ft.bewatermyfriend.org> <87txqyzcub.fsf@ft.bewatermyfriend.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Date: Thu, 03 Jan 2013 13:43:25 +0100 Message-ID: <87mwwqzbbm.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: [pbs]MzQ5NTM4 rahul wrote: >> >> Thanks a lot. I think you meant: >> > >> > % print -l ${(M)things:#(#i)*foo*} >> >> Actually, I didn't. The position of the (#i) determines where the >> case-insensitivity starts. `*' matches everything anyway, so making it >> case-insensitive does not add much. >> >> > When i typed in what you wrote I got a "zsh bad pattern" >> >> Works here, maybe you're missing "setopt extended_glob"? >> >> >> I still get a bad pattern. I am on the latest zsh (homebrew on OSX). I > added an entry called FOO and it comes up in the match. > > setopt extended_glob > > print -l ${(M)things:#*(#i)foo*} > zsh: bad pattern: *(#i)foo* > > print -l ${(M)things:#(#i)*foo*} > foo > bfoor > FOO > > echo $ZSH_VERSION > 5.0.2 Weird, here both work. From zsh -f (which starts a shell without setup files): [snip] zsh% setopt extended_glob zsh% things=( foo bar bfoor thing FOO other frob ) zsh% print -l ${(M)things:#(#i)*foo*} foo bfoor FOO zsh% print -l ${(M)things:#*(#i)foo*} foo bfoor FOO [snap] Are you maybe setting the `kshglob' option? Does it work if you do: % setopt no_ksh_glob Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925