public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: grep does not work with [^...]
Date: Sat, 05 May 2018 03:52:00 -0000	[thread overview]
Message-ID: <66cd9158-483e-79de-0b69-575c7000347b@SystematicSw.ab.ca> (raw)
In-Reply-To: <5610703131.20180504182039@yandex.ru>

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

      reply	other threads:[~2018-05-05  3:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 20:32 Bug: " Dmitry Lanin
2018-05-04 21:03 ` Michel LaBarre
2018-05-04 22:21   ` Dmitry Lanin
2018-05-05  3:52     ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66cd9158-483e-79de-0b69-575c7000347b@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).