[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shouldn't /+(??) capture 2 letter files only?

From: DJ Mills
Subject: Re: shouldn't /+(??) capture 2 letter files only?
Date: Sat, 15 Dec 2012 16:02:28 -0500

On Sat, Dec 15, 2012 at 1:01 PM, gregrwm <address@hidden>wrote:

> >> > echo !(??|foo|bar)
> >>
> >> precisely where i started this thread, !(??)
> >
> > +(??) and !(??) are completely different things. !(??) was never
> mentioned in the original question, and should work as expected.
> yow, truly, you're saying +(??) selects *any multiple* of 2chars, but
> !(??) excludes 2char names *only*!  sheesh.  ok thanks.
+(foo) in extglob works the same way as (foo)+ in ERE. +(??) is therefore
the same as (..)+, which indeed selects "one or more multiples of two
characters". *(??) is then "0 or more multiples of two characters", just
like (..)*.
If you wanted to select only one instance of what's inside the parens, you
want to use @(foo). That would be the same as simply (..) in ERE.

!() is unique, POSIX RE has no equivalent. But it basically expands to '*,
except for what's inside'. That sounds like what you're looking for to me.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]