There seems to be a case where stale values are returned by
match-beginning, match-end and match-string. To reproduce:
1. Start XEmacs with -q -no-site-file.
2. Make an empty buffer, enter "ab" and go back to the beginning.
3. Evaluate (re-search-forward "\\(a\\)").
4. Evaluate (re-search-forward "b").
Now (match-string 0) will return "b" as expected, but (match-string 1)
will return "a" from the previous search. From the documentation I
expect it to return nil (which is also how it works in FSF Emacs).
`match-beginning' and `match-end' behave similarly.
I've verified this in XEmacs 21.4 (patch 6).