def s = '-6,-3--1,3-5,7-11,14,15,17-20' println (expandRanges(s))