import re
value = []
print("请输入:")
items=[x for x in input().split(',')]
for p in items:
if len(p)<6 or len(p)>12:
continue #如果满足条件则返回for循环
else:
pass #进入下一条语句
if not re.search("[a-z]",p):
continue
elif not re.search("[0-9]",p):
continue
elif not re.search("[A-Z]",p):
continue
elif not re.search("[$#@]",p):
continue
elif re.search("\s",p):
continue
else:
pass
value.append(p)
print (",".join(value))
结果: