Partly clean the generation of regexps for repetitions.