re2: add endpos to RE2::Match, fix bugs

Adding endpos to RE2::Match allows callers to limit the ending
position of matches to points before the end of the text.

Found and fixed a few bugs involving startpos and endpos not
being handled properly.  These would only affect callers using
Match directly.  They cannot affect callers using FullMatch,
PartialMatch, and DoMatch, because those always use startpos == 0.

R=r, rsc_swtch
CC=re2-dev
http://codereview.appspot.com/4237051
8 files changed