Re.findall() & Re.finditer()

  • + 0 comments
    import re
    pattern = r'(?<=[qwrtypsdfghjklzxcvbnm])([aeiou]{2,})(?=[qwrtypsdfghjklzxcvbnm])'
    matches = re.findall(pattern, input().strip(), re.I)
    print('\n'.join(matches)) if matches else print(-1)