From: Jean Chalard <jean.chalard@gmail.com>
To: zzapper <david@tvis.co.uk>
Cc: zsh-users@sunsite.dk
Subject: Re: Excluding files & directories from a glob
Date: Thu, 6 Oct 2005 18:10:53 +0900 [thread overview]
Message-ID: <fb6be96e0510060210y7d88abd0xabe2404d3aa209da@mail.gmail.com> (raw)
In-Reply-To: <opp9k11dhp0stkp1dffh9dqmviairhcr2b@4ax.com>
> >> > grep -i 'host' **/(*.cfm~(ctpigeonbot|env).cfm)~*((#s)|/)junk*/*(.)
>
> Ok I give in what does the qualifier #s mean and do, and where is it in the doc.
The #s qualifier matches the start of a string. In the manual you can find its
description on the "13.8 Filename generation" section, under 13.8.4 :
globbing flags.
Here is the relevant chunk of documentation :
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
s, e
Unlike the other flags, these have only a local effect, and each
must appear on its own: `(#s)' and `(#e)' are the only valid
forms. The `(#s)' flag succeeds only at the start of the test
string, and the `(#e)' flag succeeds only at the end of the test
string; they correspond to `^' and `$' in standard regular
expressions. They are useful for matching path segments in
patterns other than those in filename generation (where path
segments are in any case treated separately). For example,
`*((#s)|/)test((#e)|/)*' matches a path segment `test' in any of
the following strings: test, test/at/start, at/end/test,
in/test/middle.
Another use is in parameter substitution; for example
`${array/(#s)A*Z(#e)}' will remove only elements of an array which
match the complete pattern `A*Z'. There are other ways of
performing many operations of this type, however the combination
of the substitution operations `/' and `//' with the `(#s)' and
`(#e)' flags provides a single simple and memorable method.
Note that assertions of the form `(^(#s))' also work, i.e. match
anywhere except at the start of the string, although this actually
means `anything except a zero-length portion at the start of the
string'; you need to use `(""~(#s))' to match a zero-length
portion of the string not at the start.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
--
J
"If you wish to leave a record of your call,
please state your messij at the sound of the tone."
next prev parent reply other threads:[~2005-10-06 9:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-04 15:53 zzapper
2005-10-04 16:14 ` Peter Stephenson
2005-10-04 18:25 ` zzapper
2005-10-05 3:01 ` Jean Chalard
2005-10-06 8:59 ` zzapper
2005-10-06 9:10 ` Jean Chalard [this message]
2005-10-06 10:23 ` zzapper
2005-10-06 10:52 ` Jean Chalard
2005-10-06 16:23 ` zzapper
2005-10-14 18:43 ` Hannu Koivisto
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=fb6be96e0510060210y7d88abd0xabe2404d3aa209da@mail.gmail.com \
--to=jean.chalard@gmail.com \
--cc=david@tvis.co.uk \
--cc=zsh-users@sunsite.dk \
/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).