This is called during a replace operation each time a match is found. This method appends a number to the match string and returns it as a replacement string.