We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Re.findall() & Re.finditer()
Re.findall() & Re.finditer()
Sort by
recency
|
370 Discussions
|
Please Login in order to post a comment
import re
pattern = re.compile(r"(?<=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])[AEIOUaeiou]{2,}(?=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])")
for x in re.findall(pattern, input()) or [-1]: print(x)
import re partten = r'(?<=[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])([aeiouAEIOU]{2,})(?=[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])' m = list(map(lambda x:x.group(),re.finditer(partten,input()))) if m: for i in m: print(i) else: print(-1)