Subject: Re: MBEGIN, MEND in #m when pattern has "|"
From: Sebastian Gniazdowski <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Sat, 4 Jun 2016 08:41:43 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 4 June 2016 at 07:58, Bart Schaefer <[email-masked]> wrote:
> So if you change your expression to be one of
>
>     harray=( "${(f)${text//(#mi)(${~colsearch_pattern})/|$(( MBEGIN - 1 )) $((
> MEND )) fg=red,bold|$nl}%$nl*}" )
>
> [added parens around the alternates] or
>
>     harray=( "${(f)${text//(#i)${~colsearch_pattern}(#m)/|$(( MBEGIN - 1 )) $((
> MEND )) fg=red,bold|$nl}%$nl*}" )
>
> [moved (#m) to the end] then $MBEGIN et al. work as you desire.  I suspect
> you actually want the first with the parens because otherwise the (#i) also
> ends at the "|".

This helps, thanks! In my other project I was using (), probably
because I suspected that alternative requires it.

Best regards,
Sebastian Gniazdowski