This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-12 13:44:39 +05:00
parent a0347aff39
commit bac304aab2
3 changed files with 6 additions and 8 deletions

View File

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