Semi-inclusive deep inelastic scattering: Nonperturbative and perturbative regimes