[Gambas-user] pcre: accessing named matches

T Lee Davidson t.lee.davidson at gmail.com
Wed Aug 18 22:18:54 CEST 2021


On 8/18/21 3:54 PM, loco pobre wrote:
> Hallo,
> 
> a pattern using "named capturing groups" like "title" and "artist" in "<td>(?P<title>[^<]*)</td><td>(?P<artist>[^<]*)</td>" 
> works, the matches are correctly given by index (rMatch[1].Text ...), but I don't know how to access the matches by name - is 
> there an implemented way?
> 
> (If not, I think I should make an regexp on the searchpattern to extract the names and then merge names and values of the 
> matches in an collection ...)
> 
> Merci :)
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Accessing named capture groups is apparently not implemented in Gambas. The "?P<name>[group]" syntax is for use with Python.
http://gambaswiki.org/wiki/doc/pcre


-- 
Lee


More information about the User mailing list