Bethe Ansatz approach to the pairing fluctuations in the mesoscopic regime