Fix typo

The code sample says lastIndex is 7, the text said 6. The code sample is correct.