This test passes when using java.util.regex, but fails with re2j:
@Test
public void test() {
Pattern p1 = Pattern.compile("(a.*?c)|a.*?b");
Pattern p2 = Pattern.compile("a.*?c|a.*?b");
Matcher m1 = p1.matcher("abc");
m1.find();
Matcher m2 = p2.matcher("abc");
m2.find();
assertEquals(m1.group(), m2.group());
}
Both expressions should match abc. The second one only matches ab.
Fixed in go: golang/go#13812