string = "superman"
pattern = re.compile(r'^(?:(?![aeiou])[a-z])+$', re.I)
match = pattern.match(string)
if match:
print "yes"
else:
print "no"
#------------------------
string = "dxloveuo"
pattern = re.compile(r'^(?:(?![aeiou])[a-z])+[a-z]*[aeiou]+$', re.I)
match = pattern.match(string)
if match:
print "yes"
else:
print "no"
温馨提示:答案为网友推荐,仅供参考