* 标识匹配前面的子表达式任意次,包括0次

content = '''苹果,是绿色的橙子,是橙色的香蕉,是黄色的乌鸦,是黑色的猴子,苹果,是绿'''import rep = re.compile(r',.*')for one in p.findall(content):print(one)# 输出# ,是绿色的# ,是橙色的# ,是黄色的# ,是黑色的# ,p = re.compile(r'绿色*')for one in p.findall(content):print(one)# 输出# 绿色# 绿
