Use re.sub instead of lstrip. Fix https://github.com/dmwm/CRABServer/issues/4566