From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 11 09:36:23 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6701B106566B for ; Thu, 11 Feb 2010 09:36:23 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 241458FC14 for ; Thu, 11 Feb 2010 09:36:22 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 19F821FFC22; Thu, 11 Feb 2010 09:36:22 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DE471844A6; Thu, 11 Feb 2010 10:36:21 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper References: <86tytqvwky.fsf@ds4.des.no> <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> Date: Thu, 11 Feb 2010 10:36:21 +0100 In-Reply-To: <44741B44-5EDA-4DDE-8C92-B74465BCA670@gmail.com> (Garrett Cooper's message of "Wed, 10 Feb 2010 15:40:54 -0800") Message-ID: <86wrykglm2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Andrew Brampton , freebsd-hackers@freebsd.org Subject: Re: sysctl with regex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 09:36:23 -0000 Garrett Cooper writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Garrett Cooper writes: > > > Dag-Erling Sm=C3=B8rgrav 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 +, 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