  Using an appropriate change of variable, the Schr\"odinger equation is
transformed into a second-order differential equation satisfied by recently
discovered Jacobi type $X_m$ exceptional orthogonal polynomials. This
facilitates the derivation of infinite families of exactly solvable Hermitian
as well as non-Hermitian trigonometric Scarf potentials and finite number of
Hermitian and infinite number of non-Hermitian PT-symmetric hyperbolic Scarf
potentials. The bound state solutions of all these potentials are associated
with the aforesaid exceptional orthogonal polynomials. These infinite families
of potentials are shown to be extensions of the conventional trigonometric and
hyperbolic Scarf potentials by the addition of some rational terms
characterized by the presence of classical Jacobi polynomials. All the members
of a particular family of these 'rationally extended polynomial-dependent'
potentials have the same energy spectrum and possess translational shape
invariant symmetry. The obtained non-Hermitian trigonometric Scarf potentials
are shown to be quasi-Hermitian in nature ensuring the reality of the
associated energy spectra.
