We present an exact regular solution of Einstein equations for a static and spherically symmetric spacetime with a matter distribution of isotropic perfect fluid. The construction of the solution is realized assigning a regular potential gtt and integrating the isotropic perfect fluid condition for the pressure. The resulting solution is physically acceptable, i.e. the geometry is regular and the hydrostatic variable pressure and density are positive regular monotonic decreasing functions, the speed of the sound is positive and smaller than the speed of the light. An important element of this solution is that its compactness value u=GM/c2R is in the characteristic range of compact stars, which makes a remarkable difference with other models with isotropic perfect fluid, this is u∈(0,0.3581350065] so that we could represent compact stellar objects as neutron stars. In particular, for the maximum compactness of a star with a mass of 1M⊙ the radius is R=4122.662003m and their central density ρc=1.799320999×1019Kgm3 is characteristic of compact stars.