Exemple #1
0
void RegExData::update()
{
   JM_GUARD_STACK
   strings.erase(strings.begin(), strings.end());
   positions.erase(positions.begin(), positions.end());
   if(t == type_pc)
   {
      for(unsigned int i = 0; i < m.size(); ++i)
      {
         strings[i] = JM_STD::string(m[i].first, m[i].second);
         positions[i] = m[i].matched ? m[i].first - pbase : -1;
      }
      line = m.line();
   }
   else
   {
      for(unsigned int i = 0; i < fm.size(); ++i)
      {
         strings[i] = to_string(fm[i].first, fm[i].second);
         positions[i] = fm[i].matched ? fm[i].first - fbase : -1;
      }
      line = fm.line();
   }
   t = type_copy;
}
	int _group_pos_rgx_(cmatch& grp,int i){return grp.position(i);}//the starting position in the string of the match
	int _group_length_rgx_(cmatch& grp,int i){return grp.length(i);}//the string length of selected match group
	int _group_size_rgx_(cmatch& grp){return grp.size();}//return group size
	bool _group_empty_rgx_(cmatch& grp){return grp.empty();}//check if group is empty
	bool _group_ready_rgx_(cmatch& grp){return grp.ready();}//check if group has been initialized