You are viewing a single comment's thread. Return to all comments →
import re
S = input()
vowels = 'AEIOUaeiou' consonants = 'QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm'
pattern = fr"(?<=[{consonants}])([{vowels}]{{2,}})(?=[{consonants}])"
matches = re.findall(pattern, S)
if matches: for x in matches: print(x) else: print(-1)
Seems like cookies are disabled on this browser, please enable them to open this website
Re.findall() & Re.finditer()
You are viewing a single comment's thread. Return to all comments →
import re
S = input()
vowels = 'AEIOUaeiou' consonants = 'QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm'
pattern = fr"(?<=[{consonants}])([{vowels}]{{2,}})(?=[{consonants}])"
matches = re.findall(pattern, S)
if matches: for x in matches: print(x) else: print(-1)