You are viewing a single comment's thread. Return to all comments →
import re text = input() vowels = 'aeiouAEIOU' consonants = 'qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM' pattern = rf'(?<=[{consonants}])([{vowels}]{{2,}})(?=[{consonants}])' matches = re.findall(pattern, text) if matches: for match in matches: print(match) else: print(-1)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Re.findall() & Re.finditer()
You are viewing a single comment's thread. Return to all comments →