content = "广阳区、安次区、香河县(淑阳镇、渠口镇、钱旺镇、钳屯镇、安头屯镇、刘宋镇、五百户镇)、大厂县(祁各庄镇、夏垫镇)" data = [] middle = "" flag = False result = re.split("、", content) #print(result) for i in result: if ("(" in i or flag) and ")" not in i: middle = middle + ("" if flag == False else "、") + i flag = True elif ")" in i: middle = middle + "、" + i data.append(middle) flag = False middle = "" else: data.append(i) print(data)