import re
stri = "Hello guys.\nHow are you doing?\nI hope you have sweet dreams tonight."
regex = re.compile("guys[.\n]*$")
print regex.findall(stri)
我知道.在正则表达式中可以是除换行符之外的任何字符,[xy]表示 x 或 y,*在字符表示该字符的任意数量并$表示字符串的结尾之后。那为什么不"guys[.\n]*$"给我"guys.\nHow are you doing?\nI hope you have sweet dreams tonight."?