Support named capture groups in the result of re:find
Example: (?P<name>regex) then instead of accessing it using the index one could use name to access it
This seems to have been fixed since this issue was opened or the issue is incorrect with respect to being unable to use named matches due to a misunderstanding about how to use that feature. This works for me:
> x=abcd
> re:replace '(?P<me>bc)' '($me)($0)($1)($2)' $x
▶ 'a(bc)(bc)(bc)()d'
Note that the $me dereference worked and was equivalent to $1.
There is also the question of accessing the named capturing groups in the result of re:find.
Go's regexp package doesn't have this functionality, but there is a way to do this "manually": https://stackoverflow.com/questions/20750843/using-named-matches-from-go-regex
It appears I might have misunderstood what @SitiSchu was requesting. This illustrates why a good example for how someone can reproduce an issue is important. The solution in the stackoverflow question could be implemented by adding something like a &name key to the match object returned by re:find. Where the value of the &name key is a map whose keys correspond to each named subexpression and the value is a [&text=$t &start=$s &end=$e] map as found in the &groups list for each indexed subexpression.