zsh-users
 help / color / mirror / code / Atom feed
From: Nick Cross <zsh@goots.org>
To: dana <dana@dana.is>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Glob and grep
Date: Tue, 17 Dec 2019 07:30:44 +0000	[thread overview]
Message-ID: <525f37ee-75b9-7528-f732-a4fe14d79a54@goots.org> (raw)
In-Reply-To: <18417C9E-0212-4E3C-A301-1BBA35F61051@dana.is>

On 16/12/2019 23:18, dana wrote:
> On 16 Dec 2019, at 16:44, Nick Cross <zsh@goots.org> wrote:
>> While I found information about ^(xxx) it wasn't clear how to have multiple
>> expressions to ignore.
> 
> In addition to Mikael's suggestion you can also use the x~y syntax, which i
> personally find less confusing, and is effectively `m/x/ && !m/y/` in Perl:
> 
>    **/*.groovy~*/(test|target)/*
>    # or you can chain multiple y patterns
>    **/*.groovy~*/test/*~*/target/*
> 
> (Note that, like zshexpn(1) says, / and . are not special in the y pattern)
> 
> On 16 Dec 2019, at 16:44, Nick Cross <zsh@goots.org> wrote:
>> Am I right in thinking I can add (.) to e.g. *.groovy to ensure I only
>> search for files as well ?
> 
> Use (-.) if you also want to match symlinks to files (which is common)
> 
> dana
> 


Firstly, thanks everyone for the replies. The '~' syntax is interesting; 
so effectively the negated options are put at the end.

Nick

  reply	other threads:[~2019-12-17  7:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 22:44 Nick Cross
2019-12-16 23:10 ` Mikael Magnusson
2019-12-16 23:24   ` Dominik Vogt
2019-12-17  1:20     ` Daniel Shahaf
2019-12-17  7:31       ` Nick Cross
2019-12-17  7:31   ` Nick Cross
2019-12-17  9:39     ` Mikael Magnusson
2019-12-16 23:18 ` dana
2019-12-17  7:30   ` Nick Cross [this message]
2019-12-17 10:00 ` zzapper

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=525f37ee-75b9-7528-f732-a4fe14d79a54@goots.org \
    --to=zsh@goots.org \
    --cc=dana@dana.is \
    --cc=zsh-users@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).