Hi Bram,

On 4/24/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> At least the matching submatches should be returned.  When some of the
> last submatches don't match it would still be easy if you can access the
> resulting list without having to check if the item is really there.
> Thus matchlist() should always return a list with ten items.  Submatches
> that didn't match will then have an empty item.
>
> Example: echo matchlist('acd', '\(a\)\?\(b\)\?\(c\)\?\(.*\)')
>         Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', '']
>

Yes... This is (almost) exactly what I wanted. I guess making it not
have the restriction that only 10 groups are allowed would be perfect.
I just checked that the biggest RE I have personally ever used has
7 groups... So I guess I will not have any problems even with the
restriction.

Thanks,
Srinath

Reply via email to