Wrong number of matching groups returned in RegularMatch
RegularMatch.toMap()
returns the wrong number of matching groups. For instance, if in a certain textual tuple space there's the tuple name: FirstName; surname: LastName
and I try to match it with the template name: (.*); surname: (.*)
, I'd expect the resulting RegularMatch.toMap()
:
- Group 0:
name: FirstName; surname: LastName
- Group 1:
FirstName
- Group 2:
LastName
However, currently the group 2 is not added to the map, since groupCount()
returns the matching groups without counting the one that contains the whole match (i.e. group 0).
Edited by Nicolò Di Domenico