Re.findall() & Re.finditer()

  • + 0 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