You are viewing a single comment's thread. Return to all comments →
import re
pattern = re.compile(r"(?<=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])[AEIOUaeiou]{2,}(?=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])")
for x in re.findall(pattern, input()) or [-1]: print(x)
remove the extra logic and just force a -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
pattern = re.compile(r"(?<=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])[AEIOUaeiou]{2,}(?=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])")
for x in re.findall(pattern, input()) or [-1]: print(x)