The restricted active space configuration interaction (RASCI) formalism with the hole and particle truncation of the wavefunction, that is, RASCI(h,p), holds very nice properties such as balanced treatment of ground and low-lying excited states, spin-completeness, large flexibility of the wavefunction, and moderate computational cost. In this article, I present a new implementation of the RASCI(h,p) method using a general algorithm based on the integral-driven approach. The new implementation allows to choose any electronic configuration as the single reference in combination with an excitation operator with any number of ionization, electron attachment, or spin-flip (SF) excitations. The applicability and good performance of the new computational code is tested in the ground state calculation of water molecule with increasingly large active spaces and up to the full-CI limit, the calculation of all-trans linear polyenes with variable number of SF excitations, and the low-lying states of fluorine molecule with a double-ionization potential operator. © 2012 Wiley Periodicals, Inc.