optimize ExpPattern