From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38175 invoked by alias); 30 Aug 2019 07:50:09 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 38157 invoked by uid 89); 30 Aug 2019 07:50:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.1 spammy=replying, H*M:yandex, HX-Languages-Length:1427, H*x:Bat! X-HELO: forward103j.mail.yandex.net Received: from forward103j.mail.yandex.net (HELO forward103j.mail.yandex.net) (5.45.198.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Aug 2019 07:50:06 +0000 Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 6A3A667415F9; Fri, 30 Aug 2019 10:50:03 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3Cm6hs659L-o2VWaJvS; Fri, 30 Aug 2019 10:50:03 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1567151403; bh=gsmz+OHsEqcCXkrj4+9n/n3H8IHID3P8syWO6iAOOSs=; h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date; b=YhQY17zWxu8myDFOlAbWnQz3irUk2OjQ7HbsoC5k3BKg5h7+w60mvInQHkYpLLxIL vT4vpMZzrBnwHqAGuO5m6SltSqvftsqyXc4DSJTcijPHCPVU8ZaBPH0zhBVcgmaodf 7u/Xwv1DqBqMlogDYWX1MSRBVajgMwz13jocxuSo= Authentication-Results: mxback3g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5EAYadoqTq-o1Z40hek; Fri, 30 Aug 2019 10:50:01 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 30 Aug 2019 07:44:00 -0000 Date: Fri, 30 Aug 2019 07:55:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <42748516.20190830104400@yandex.ru> To: Eliot Moss , cygwin@cygwin.com Subject: Re: bug with grep 3.0.2 in cygwin 3.0.7 In-Reply-To: <806ab587-a07c-1616-1486-ebb258ace1d9@cs.umass.edu> References: <1910922536.1217465852.1566975322390.JavaMail.root@zimbra76-e14.priv.proxad.net> <1207614124.1217647925.1566976580120.JavaMail.root@zimbra76-e14.priv.proxad.net> <8910174142.20190829220811@yandex.ru> <806ab587-a07c-1616-1486-ebb258ace1d9@cs.umass.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00414.txt.bz2 Greetings, Eliot Moss! >>> 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 >> >> That's an expected result of an impossible constraint. >> >>> I have to backslash ^ to be OK like : grep -E 'a\^b' >> >> Yes. >> >>> Is-it a bug ? >> >> No. >> >>> I don't know if all versions of cygwin and grep are concerned. >> >> RTFM, this is regexp basics. > There was a really great answer to this earlier. I tried an > answer, but was wrong. One has to read the "fine print" really > carefully. At first I thought it was a bug, at least in the > documentation, but the meaning of a^b, when ^ is the metacharacter, > is kind of subtle (IMO at least). It's easy to miss that > subtlety and think that if ^ is not at the beginning of an > expression it will be treated as an ordinary character ... > But my main point is that RTM would be enough; RTFM seemed > to me perhaps a little more rude than necessary. Adding to the earlier answers (sorry, replying on the road is not efficient), there's a https://www.regular-expressions.info/ Which contains a great deal of information about RE, their kinds, caveats and implementations in various languages. -- With best regards, Andrey Repin Friday, August 30, 2019 10:42:35 Sorry for my terrible english... -- 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