The pluralization of the ids did not work on subsequent calls

The pluralization of the document ids did not work on subsequent calls. Now we
reset lastIndex of the Regexp-object on each call to fix it.

Full explanation:
http://stackoverflow.com/questions/4724701/regexp-exec-returns-null-sporadically