...和一个单词前几位是辅音字母后几位是元音字母
发布网友
发布时间:2024-10-02 07:29
我来回答
共1个回答
热心网友
时间:2024-10-19 13:35
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"
热心网友
时间:2024-10-19 13:29
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"