[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.
- shouldn't /+(??) capture 2 letter files only?, gregrwm, 2012/12/13
- Re: shouldn't /+(??) capture 2 letter files only?, Dan Douglas, 2012/12/13
- Re: shouldn't /+(??) capture 2 letter files only?,
DJ Mills <=
- Re: shouldn't /+(??) capture 2 letter files only?, Dan Douglas, 2012/12/13
- Re: shouldn't /+(??) capture 2 letter files only?, gregrwm, 2012/12/14
- Re: shouldn't /+(??) capture 2 letter files only?, Rene Herman, 2012/12/14
- Re: shouldn't /+(??) capture 2 letter files only?, gregrwm, 2012/12/14
- Re: shouldn't /+(??) capture 2 letter files only?, Rene Herman, 2012/12/14
- Re: shouldn't /+(??) capture 2 letter files only?, DJ Mills, 2012/12/14
- Re: shouldn't /+(??) capture 2 letter files only?, gregrwm, 2012/12/15
- Re: shouldn't /+(??) capture 2 letter files only?, DJ Mills, 2012/12/15
- Re: shouldn't /+(??) capture 2 letter files only?, gregrwm, 2012/12/16
Re: shouldn't /+(??) capture 2 letter files only?, Rene Herman, 2012/12/13