bug-bash
[Top][All Lists]
Advanced

[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: Thu, 13 Dec 2012 21:25:02 -0500

On Thu, Dec 13, 2012 at 8:58 PM, Dan Douglas <ormaaj@gmail.com> wrote:

> So, +(??) actually matches strings with even length, while +(???) matches
> those with odd length. +(?) matches any string with at least one character,
> and any number of ?'s matches multiples of that length.
>
>  $ ksh -c 'printf %R\\n \?'
> ^.$
>  $ ksh -c 'printf %R\\n "+(?)"'
> ^(.)+$
>  $ ksh -c 'printf %R\\n "+(??)"'
> ^(..)+$
>
> --
> Dan Douglas
>
>
+(???) matches lengths that are multiples of 3, not all odd-length files.
?+(??) would match odd-length files.

For the original question, you would want /@(??) or simply /??, since
there's no need for extglob for that.


reply via email to

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