correct parsing of repeat operators