Avoid using the forward DFA in "ANCHOR_END" cases.

In UNANCHORED cases where the regexp is anchored explicitly at the end
only, we don't need the forward DFA because we already know where the
match must end! Instead, the reverse DFA can say whether there is a
match and (optionally) where it starts.

Change-Id: I52ee19626863d06b9c52dc107eb46c3ba9eabf63
Reviewed-on: https://code-review.googlesource.com/c/re2/+/51290
Reviewed-by: Paul Wankadia <junyer@google.com>
1 file changed