use pattern replacement for index file