X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:date:from:to:subject:in-reply-to :references:message-id; q=dns; s=default; b=oPjkXElhL1nDZmsYGfd7 9LIbwkJUn19oUuee7RwZ7Auf23hzBsC0RKI1aItMUnoUO93rRWqA9/CC6OZbVrI9 4SJutc9d9ydDTKilHonNap+hJx5b7x5U0RJEVyZGtLQNYGGoyiFPzH9VV/rZHh0n YEC/Elr9FYYroX8/TKR1hws= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:date:from:to:subject:in-reply-to :references:message-id; s=default; bh=L6K6azvNsvsLthFSEBp/TNT0Og 8=; b=wNO1R1ro+iGR3YKlRGj5wgFeJc+3ulUTX+nOsS9IEVssLG7kGuxXBx5lRT 2M99p4QKjifsVYHhPMOrURmUtxKXnHRRPjPdEJDlXsgbQaV1LU1X4JiQ44La0/cK 5uZHOeNr23zgNAA9LnU6dJWwDfr1pLm9Y5K3JDsBujsWoL7Bw= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_50,KAM_NUMSUBJECT autolearn=no version=3.3.1 spammy=vast, meta, H*UA:Webmail, H*UA:Roundcube X-HELO: www16.qth.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 22 Sep 2019 14:54:29 -0400 From: Chris Wagner To: cygwin AT cygwin DOT com, akiki AT free DOT fr Subject: Re: bug with grep 3.0.2 in cygwin 3.0.7 In-Reply-To: <1207614124.1217647925.1566976580120.JavaMail.root@zimbra76-e14.priv.proxad.net> References: <1207614124 DOT 1217647925 DOT 1566976580120 DOT JavaMail DOT root AT zimbra76-e14 DOT priv DOT proxad DOT net> Message-ID: X-Sender: wagnerc AT plebeian DOT com User-Agent: Roundcube Webmail/1.3.8 X-IsSubscribed: yes On 2019-08-28 3:16 am, akiki AT free DOT fr wrote: > Hi, > I encounter some problem with grep option -E on cygwin 3.0.7 > > > echo "a^b" | grep "a^b" #answer a^b ie it's OK > but > echo "a^b" | grep -E "a^b" #answer nothing " for me it's KO > > > I have to backslash ^ to be OK like : grep -E 'a\^b' > > > Is-it a bug ? > I don't know if all versions of cygwin and grep are concerned. Hi Akiki. As others mentioned, it has to do with how regular expressions operate. However the best solution for you in this situation is to not use regular expressions. To search for fixed strings, use fgrep or grep -F. That avoids all issues with meta characters and covers the vast majority of cases when we use grep anyway. To use full power regular expressions read perlre and use grep -P. Thanks. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple