This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: grep does not work with [^...]
- From: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- To: cygwin at cygwin dot com
- Date: Fri, 4 May 2018 21:52:50 -0600
- Subject: Re: grep does not work with [^...]
- References: <1594742711.20180504163154@yandex.ru> <000901d3e3eb$5d56ddb0$18049910$@rogers.com> <5610703131.20180504182039@yandex.ru>
- Reply-to: Brian dot Inglis at SystematicSw dot ab dot ca
On 2018-05-04 16:20, Dmitry Lanin wrote:
> Friday, May 4, 2018, 5:03:32 PM, Michel LaBarre wrote:
>>> On May 4, 2018 4:32 PM Dmitry Lanin wrote:
>>> Bug: grep does not work with [^...]
>>> Run the following command:
>>> echo qwe | grep -E '[^r]'
>>> Expected result:
>>> qwe
>>> Actual result:
>>> -nothing-
>> Run it in bash instead.
>> ^ is a quote character in CMD.
> Yes, I guessed it is a special character, so I tried (did not work):
> echo qwe | grep -E '[\^r]'
> I have finally figured out. Using double-quotes work:
> echo qwe | grep -E "[^r]"
Safer to double it under cmd:
> echo ^^
^
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
--
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