1. newPath = newPath.replace(/pageCounter=-?(\d)/i , "i");