【正则表达式应用】不规则多维数组展平一维
l = [[1, 2], [3, 4], [5, [6, 7, [8, 9]]], 10, [11, [12, 13, [14, 15, [16]]]]]
eval(re.sub("(?!^)\[|\](?!$)", "", str(l))) # 小小明
[int(i) for i in re.findall('\d+',str(l))] # 原创
原文:
https://blog.csdn.net/as604049322/article/details/112387064
-------------------------------
********厚德达理,励志勤工********
-------------------------------