Skip to content
Snippets Groups Projects
Commit 12aa2d3c authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: SubStrings::str(int) method for similarity with std::smatch

- define regExp::results_type using SubStrings container for handling
  groups. This makes a later shift to std::smatch easier, but changes
  the regExp API for matching with groups. Previously had list element
  0 for regex group 1, now list element 0 is the entire match and list
  element 1 is regex group 1.

  Old:
      List<std::string> mat;
      if (re.match(text, mat))  Info<< "group 1: " << mat[0] << nl;

  New:
      regExp::results_type mat;
      if (re.match(text, mat))  Info<< "group 1: " << mat.str(1) << nl;
parent 82a9f2c9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment