kokizzu / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

RE2::Set hides match information, mishandles captures #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Add multiple REs to a set, each using capture:

   set.Add("(food)", NULL);
   set.Add("(foot"), NULL);

This can be done easily with re2/testing/set_test.cc

2.  set.Compile(), set.Match()
3.  A couple of problems.
-  The Match() vector says which set items matched, but the API
   hides additional information about those REs.  The API should
   export more information.
-  Internally, the RE2::Prog assigns the same capture register to
   each of the set items above.  Even if one could query the individual
   set items, the capture information would be incorrect. 

What is the expected output? What do you see instead?
-  Capture registers are unavailable through the API.
-  The API needs enhancement to expose additional information.
-  The program capture instructions use the same register for
   (foot) and (food).  They should use different registers.

What version of the product are you using? On what operating system?
Using version re2:20140304 on Centos 6.5.
(The OS is not relevant to this issue.)

Please provide any additional information below.
NOTE: If you have a suggested patch, please see
http://code.google.com/p/re2/wiki/Contribute
for information about sending it in for review.  Thanks.

Original issue reported on code.google.com by j.q.arn...@live.com on 28 Aug 2014 at 12:52

GoogleCodeExporter commented 9 years ago
RE2 has moved to GitHub. I have not moved the issues over. If this issue is 
still important to you, please file a new one at 
https://github.com/google/re2/issues. Thank you.

Original comment by rsc@golang.org on 11 Dec 2014 at 4:45