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

Re: named capture groups with PCRE matching (Was: PATCH: migrate pcre module to pcre2)



On Fri, May 5, 2023 at 9:44 PM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
>
> 2023-05-06 01:35:46 +0200, Oliver Kiddle:
> [...]
> >  * named capture groups
> >    (either to an associative array or to variables directly?)
> [...]
>
> Maybe [...]
>
> [...] if $match is an associative array, store the named
> capture groups there. Same for pcre_match -a array (or add a -A
> assoc there)

Since this would be new functionality anyway, perhaps it's a good
opportunity to take advantage of namespaces, e.g. ${.pcre.match[foo]}
etc., instead of overloading the existing variables.




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