The bounce averaged Fokker-Planck equation for the distribution function of ripple trapped particles in a tokamak has been solved, for arbitrary collision frequencies, in the 'tokamak' limit in which ripple wells are localized close to the midplane. The equation includes the main terms contributing to collisionless (de)trapping. The solution employs power series expansions for the distribution function in the pitch angle variable k2 and the poloidal angle θ; the series in k2 and θ both terminate. The boundary conditions applied at the trapping/detrapping boundary, that f and ∂f/∂k2 be continuous, become the requirement that in the collisionless limit the derivative with respect to k2 reflect the scale length set by the motion in toroidally blocked orbits. The resulting series solutions reduce to the usual expressions in the high collision frequency limit, but they are considerably lower than the results of previous calculations (which neglect the collisionless detrapping effects), in the low collision frequency limit. Comparison with Monte Carlo calculations for INTOR parameters shows that, in all cases, the analytic results lie somewhat below the numerical results, which is to be expected since banana drift diffusion is also present in the Monte Carlo calculation. However, previous analytic calculations give diffusion coefficients which are much larger than the Monte Carlo results.