namespace Msp {
-RegMatch::RegMatch(const string &str, const GroupArray &g):
- groups(g)
+RegMatch::RegMatch(const string &str, const vector<Group> &grps):
+ groups(grps)
{
- for(GroupArray::iterator i=groups.begin(); i!=groups.end(); ++i)
- if(i->match)
+ for(Group &g: groups)
+ if(g.match)
{
- i->length = i->end-i->begin;
- i->str = str.substr(i->begin, i->length);
+ g.length = g.end-g.begin;
+ g.str = str.substr(g.begin, g.length);
}
}