Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $match size limit, suspicious (#B) behavior



One other thing ...

On Mon, Oct 17, 2016 at 7:51 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> [Sebastian Cc'd in case the list is still having indigestion over gmail MTAs]
>
> If I add another set of parens around everything that follows (#B) up
> to just before the close of the paren that opens before (#B), it looks
> like what I expect:
>
> % [[ 12345 = (#b)(?)((#B)((?)|([[:alnum:]](#c0,1))(?)))(#b)(*) ]]
> % print -l :$^match
> :1
> :2
> :345

With (p1|p2) zsh always matches left-to-right, not longest.  So
reversing the order of the alternate subexpressions:

% [[ 12345 = (#b)(?)((#B)(([[:alnum:]](#c0,1))(?)|(?)))(#b)(*) ]]
% print -l :$^match
:1
:23
:45



Messages sorted by: Reverse Date, Date, Thread, Author