From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8598 invoked by alias); 2 Jul 2013 23:25:12 -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: 17853 Received: (qmail 6486 invoked from network); 2 Jul 2013 23:24:58 -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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=WC2O3d7Yw7chF5fn9Ih7bBwPvA84ZWf64UxuSjkajxo=; b=hcMXCbyel32mfPe3mM46uut3HAdfbK+60lAQAlxx7vLLQQ+CKqY2A2I52CzeX0c8i77op4jg2oWYthCF14+JtNIITWsT0150nLsy2CYbqWUeF9Nt71U8D4TiuW/SRuczhGelV4F6X0MFWzo+5iwUdzY/uKQgOs5iyIyRm27wgh8=; Date: Tue, 2 Jul 2013 19:24:47 -0400 From: Phil Pennock To: ZyX Cc: TJ Luoma , Zsh-Users List Subject: Re: input foo, output '[F|f][O|o][O|o]'? Message-ID: <20130702232446.GA1583@redoubt.spodhuis.org> Mail-Followup-To: ZyX , TJ Luoma , Zsh-Users List References: <215891372737080@web15e.yandex.ru> <497991372737643@web23e.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <497991372737643@web23e.yandex.ru> On 2013-07-02 at 08:00 +0400, ZyX wrote: > > > Phil Pennock's version worked great: > > > > > > % foo=CrashPlan > > > % for c in ${(s::)foo}; do print -n "[${(U)c}|${(L)c}]";done; print > > > [C|c][R|r][A|a][S|s][H|h][P|p][L|l][A|a][N|n] Sorry, I was in a rush and missed that this was [A|B] which should of course be written [AB] or (A|B) if the regexp language supports the latter. I should have caught that, instead of answering exactly what was asked. > > Unless AddDescription uses different regex engine then FilesMatch > > answer is in the first link if searching for "htaccess case > > insensitive regex": (?i:pattern). > > It seems it does use different regex engine. AddDescription does not take a regex. It takes a filename pattern, or what in shell is called a Glob. It happens that some shells use [AB] as a glob pattern too, also to introduce a character class, and that's why it works -- Apache supports that syntax also. Those places in Apache that do take regexps use the PCRE engine, the one written by Philip Hazel for Exim, and which zsh also supports with "zmodload zsh/pcre" (or setting the option to change =~ to use it, "setopt rematch_pcre", which will auto-load that module when you first use =~). So those places in Apache which want regexps, you can test with zsh to get a decent approximation, or use the pcretest(1) tool from the PCRE distribution to get something designed to interactively test regexps against inputs. If you want to settle on that syntax, also consider installing the pcregrep tool. It's very nice to be able to relax and just use PCRE syntax, even though the PCRE implementation is not as efficient as the older tools (or the newer RE2 system). -Phil