This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-12 00:10:43 +05:00
parent a29990d847
commit a0347aff39

View File

@@ -1,7 +1,7 @@
import re import re
str1=open('24_5.txt').read().strip('\n') str1=open('24_5.txt').read().strip('\n')
result=re.split(r'(?<=PP)',str1) #Позитивная ретроспективная проверка (Positive Lookbehind) # result=re.split(r'(?<=PP)',str1) #Позитивная ретроспективная проверка (Positive Lookbehind)
result=re.split(r'(?=PP)',str1) #позитивная опережающая проверка (positive lookahead) result=re.split(r'(?=PP)',str1) #позитивная опережающая проверка (positive lookahead)
# result=re.split(r'P(?=P)',str1) # result=re.split(r'P(?=P)',str1)
print(max(list(map(len,result)))) print(max(list(map(len,result))))