Here's the problem statement: Return the original text where in that original text: after each consonant a random vowel has been inserted after each vowel, the vowel has been replicated twice And what I've tried: text = "hieeelalaooo" #original string is hello pat1 = "(?=[^aeiouy][aeiouy])\\w" #const then random vowel ans1=re.findall(pat1,text) #ans1 = ['h', 'l', 'l'] pat2 = "([aeiouy])\\1\\1" #vowel replicated twice ans2=re.findall(pat2,text) #ans2 = ['e', 'o'] ans = re.findall(pat1 + "|" + pat2, text) #ans = ['', 'e', '', '', 'o'] I was hoping that ans would be 'hello'. I'm sure there are a numerous ways to meet the goal, but I'm interested in why this doesn't work. Continue reading...