file looping and zero-length regexes