title: Google re2 namedcapture, how to parse results in c++?
body: <p>using google re2 library for regex i haven't found a way to parse results, anywhere!</p>
  
  <p>this is a short example</p>
  
  <pre><code>bool b_matches ;
  string s_teststr = " aaaaa flickr bbbb";
  RE2 re("(?P&lt;flickr&gt;flickr)|(?P&lt;flixster&gt;flixster)");
  assert(re.ok()); // compiled; if not, see re.error();
  b_matches = RE2::FullMatch(s_teststr, re);
  
    b_matches = RE2::FullMatch(s_teststr, re);
  
  // then,
  re.NumberOfCapturingGroups() //-&gt; always give me 2
  
   re.CapturingGroupNames(); //-&gt; give me a map with id -&gt; name (with 2 elements)
  
  re.NamedCapturingGroups() //-&gt; give me a map with name -&gt; id (with 2 elements)
  </code></pre>
  
  <p>what i have to do to know that only flickr has been matched ?</p>
  
  <p>thank you,</p>
  
  <p>Francesco</p>
  
  <p>--- after some more testing i didn't have found a soltuion for the namedcapture, only way thing i have found working give me the extracted text and is this.</p>
  
  <pre><code>string s_teststr = "aaa  hello. crazy world bbb";
  std::string word[margc];
  RE2::Arg margv[margc];
  RE2::Arg * margs[margc];
  int match;
  int i;
  
      for (i = 0; i &lt; margc; i++) {
          margv[i] = &amp;word[i];
          margs[i] = &amp;margv[i];
      }
     string s_rematch = "((?P&lt;a&gt;hello\\.)(.*)(world))|(world)";
    match = RE2::PartialMatchN(s_teststr.c_str(), s_rematch.c_str(), margs, margc);
  cout &lt;&lt; "found res = " &lt;&lt; match &lt;&lt; endl;
    for (int i = 0; i &lt; margc; i++) {
          cout &lt;&lt; "arg[" &lt;&lt; i &lt;&lt; "] = " &lt;&lt; word[i] &lt;&lt; endl;
      }
  </code></pre>
  
  <p>-------- this will give me in output:</p>
  
  <blockquote>
    <p>found res = 1 arg[0] = hello. crazy
    world arg[1] = hello. arg[2] =  crazy
    arg[3] = world arg[4] =</p>
  </blockquote>
  
  <p>to test with the second part of the string matching...</p>
  
  <pre><code>string s_rematch = "((?P&lt;a&gt;hello\\.d)(.*)(world))|(world)";
  </code></pre>
  
  <p>--- i get as output:</p>
  
  <blockquote>
    <p>foudn res = 1
    arg[0] =
    arg[1] =
    arg[2] =
    arg[3] =
    arg[4] = world</p>
  </blockquote>
  
  <p>my problem is taht the name capture --> a &lt;--- never come out and the output should be cleared (lowercase in case of insensitive match, removed from added compatibily chars,.. ) and processed again against a map because i don't have the named capture which give me the key instead of the value for this preg</p>