Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2010 10:36:21 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        Andrew Brampton <brampton+freebsd@gmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: sysctl with regex?
Message-ID:  <86wrykglm2.fsf@ds4.des.no>
In-Reply-To: <44741B44-5EDA-4DDE-8C92-B74465BCA670@gmail.com> (Garrett Cooper's message of "Wed, 10 Feb 2010 15:40:54 -0800")
References:  <d41814901002091308s7e894b55p880bde165bbbe703@mail.gmail.com> <86tytqvwky.fsf@ds4.des.no> <d41814901002091528i4884987cmb7347dfe4d50bdc5@mail.gmail.com> <26049703-8844-4476-B277-776A4EFC0A53@gmail.com> <86fx59jpti.fsf@ds4.des.no> <7d6fde3d1002100923i6bbc24a7ocaf408f4d78ec59f@mail.gmail.com> <868wb1hqzs.fsf@ds4.des.no> <44741B44-5EDA-4DDE-8C92-B74465BCA670@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Cooper <yanefbsd@gmail.com> writes:
> Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > Garrett Cooper <yanefbsd@gmail.com> writes:
> > > Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > > > The glob pattern syntax has no equivalent for +, ?, {m,n},
> > > > (foo|bar), etc.
> > > +, {}, and () -- no... that's typically an extension to shell expanded
> > > values (IIRC). ?
> > I can't make sense of this - I'm not sure whether you misunderstood what
> > I wrote, or just failed to express yourself clearly...
> Ok -- redo: +, {} and () aren't typical shell glob operators.

I never said they were...

> They're typically extensions in certain shells (bash for instance).

I don't know of any shell where {} has the same meaning as in regular
expressions; it's usually an alternation that's evaluated before
globbing.  For instance, in both bash and zsh, the following will create
foo.txt, bar.txt and baz.txt:

  touch {foo,bar,baz}.txt

whereas if {} were evaluated during globbing, the glob pattern wouldn't
match anything, and the command would either fail or create the file
"{foo,bar,baz}.txt".

Zsh has # for +, <m-n> for {m,n} and (foo|bar) for (foo|bar) (it treats
the pipe character differently when it's inside parentheses).  Bash has
neither of these.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86wrykglm2.fsf>