On Sat, Dec 15, 2012 at 1:01 PM, gregrwm <backuppc-us...@whitleymott.net>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.