What steps will reproduce the problem?
RE2::Set s(RE2::DefaultOptions, RE2::ANCHOR_START);
s.Add("foo$", NULL);
s.Compile();
vector<int> v;
s.Match("foo", &v);
CHECK_EQ(v.size(), 1);
What version of the product are you using? On what operating system?
Rev b49abcd41429, 64-bit Linux.
Please provide any additional information below.
DFA::InlinedSearchLoop checks for upcoming matches before the last byte is
processed, so it misses any matches lurking behind trailing zero-width
assertions.
I've attached a crude but small fix. It moves the match collection down past
the last byte processing, and modifies DFA::RunWorkqOnByte to keep re-adding
match instructions to the queue when kind == kManyMatch so they'll get picked
up at the end.
Original issue reported on code.google.com by dhaf...@gmail.com on 20 Oct 2011 at 9:16
Original issue reported on code.google.com by
dhaf...@gmail.com
on 20 Oct 2011 at 9:16Attachments: