You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The overall match found should not depend on capturing parens. In this case, the a.*?c branch of the alternative should take priority over the a.*?b branch in both expressions, so both should match [0 3] not [0 2].
This happens in C++ RE2 as well.
The text was updated successfully, but these errors were encountered:
The problem is caused by factoring of common prefixes in alternations. Complex subexpressions (e.g. involving quantifiers) aren't safe to factor because that collapses their distinct paths through the automaton.
The fix that I've proposed for RE2 is very simple. I'll port it to Go with @rsc's blessing.
http://play.golang.org/p/n5XbC7kTDt
The overall match found should not depend on capturing parens. In this case, the
a.*?c
branch of the alternative should take priority over thea.*?b
branch in both expressions, so both should match [0 3] not [0 2].This happens in C++ RE2 as well.
The text was updated successfully, but these errors were encountered: