In this paper, we establish exact solutions for nonlinear evolution equations in mathematical physics. The exp-transform method is proposed to seek solitary solutions, periodic solutions and compaction-like solutions of nonlinear differential equations. The generalized KdV equation and the system of the shallow water wave equation are chosen to illustrate the effectiveness and convenience of the method.