Optimize to avoid some unnecessary RegExp matches by reusing previous captures.
JRuby doesn't like how these tests were written and constantly bombed out.