delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/08/30/03:51:06

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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=fIQEsspEp9veNP9O
rAqRrLkr3mHcwuPKK+x7voGOgqdmDqyI8be8j9C3qikkYbAxflsbbmtwSW6l3Ka1
uStjPPhfLQTfZMOeic9ru3unJ56LaR2rwH3wlXMK3p1Ir5EU5cWpQIo1XQ0RwPjU
1YIjYYORaaOE+MQKr+1mgVN/lo0=
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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=PZfSYBZBk7TOJ3iZ+PpxQP
dDCzo=; b=Wj8Wetei1Hxq4S1VHU21AGkY+ag8rsKSP60VvALB+x2IkS56VyL1Ac
uR7BxrDjloHrUgYNM4mEeD9HnhAP9GeV9utMNnve9uqP62XA/cvRIWML0b7MUNFz
QK7hL3egLF5d7G4sS5ovQ8lCx7F1CZBuJRmOAYx4A4/rgYcRIB/Ik=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.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
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
Date: Fri, 30 Aug 2019 10:44:00 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <42748516.20190830104400@yandex.ru>
To: Eliot Moss <moss AT cs DOT umass DOT edu>, cygwin AT cygwin DOT 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 DOT 1217465852 DOT 1566975322390 DOT JavaMail DOT root AT zimbra76-e14 DOT priv DOT proxad DOT net> <1207614124 DOT 1217647925 DOT 1566976580120 DOT JavaMail DOT root AT zimbra76-e14 DOT priv DOT proxad DOT net> <8910174142 DOT 20190829220811 AT yandex DOT ru> <806ab587-a07c-1616-1486-ebb258ace1d9 AT cs DOT umass DOT edu>
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019