import rematches = re.findall(r"(?<=[^aeiouAEIOU])([aeiouAEIOU]{2,})(?=[^aeiouAEIOU])", input())if matches:for each in matches:print(each)else:print(-1)
Re.start() & Re.end()
import res =input()k =input()match =list(re.finditer(rf"(?=({k}))", s))if match:for each in match:print((each.start(1), each.end(1) -1))else:print((-1, -1))
import refor _ inrange(int(input())): if re.match(r'^[456]\d(\d)(?!\1\-?\1{2})\d(-?)\d{2}(\d)(?!\3\-?\3{2})\d\2\d{2}(\d)(?!\4\-?\4{2})\d\2\d{2}(\d)(?!\5\-?\5{2})\d$', input()):
print('Valid')else:print('Invalid')
Validating Postal Code
# Use PyPy3regex_integer_in_range =r'^[1-9]\d{5}$'# Do not delete 'r'.regex_alternating_repetitive_digit_pair =r'(\d)(?=\d\1)'# Do not delete 'r'.import reP =input()print (bool(re.match(regex_integer_in_range, P)) andlen(re.findall(regex_alternating_repetitive_digit_pair, P)) <2)
Matrix Script
import ren, m =map(int, input().strip().split())matrix = [list(input())for _ inrange(n)]decodedScript ="".join(["".join(each) for each inlist(zip(*matrix))])print(re.sub(r'\b\W+\b', ' ', decodedScript))