Re.findall() & Re.finditer()

  • + 0 comments
    import re 
    
    S = input()
    a=map(lambda x: x.group(),re.finditer(r'(?<=[qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM])([A,E,I,O,U,a,e,i,o,u]{2,})(?=[qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM])',S))
    q=list(a)
    k=bool(q)
    if k==False:
        print('-1')
    else:
        for t in q:
            print(t)