Re.findall() & Re.finditer()

  • + 0 comments
    import re
    
    pattern = r'(?<=[qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM])([aeiouAEIOU]{2,})(?=[qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM])'
    results = list(re.finditer(pattern, input()))
    print(*[x.group(1) for x in results] if results else [-1], sep="\n")