You are viewing a single comment's thread. Return to all comments →
import re if __name__ == '__main__': re_pattern = r'(?<=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])([aeiouAEIOU]{2,})(?=[QWRTYPSDFGHJKLZXCVBNMqwrtypsdfghjklzxcvbnm])' input_string = input().rstrip() matched_str = list(re.finditer(re_pattern, input_string)) if not matched_str: print(-1) else: wanted = list(map(lambda x: x.group(1), matched_str)) for w in wanted: print(w)
Seems like cookies are disabled on this browser, please enable them to open this website
Re.findall() & Re.finditer()
You are viewing a single comment's thread. Return to all comments →