Created
December 19, 2016 04:40
-
-
Save hackerdem/50731d28c3d1278479309a51681ad903 to your computer and use it in GitHub Desktop.
Revisions
-
hackerdem created this gist
Dec 19, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import sys,re with open('C:/Users/erdem/Desktop/memories/newe.txt', 'r') as test_cases: for test in test_cases: if test in ['','\n']:pass else: v=re.search('([-;\w]+)', test).group(0) vqq=';'.join(re.findall('([\d|\w]+-[\d|\w]+)', test)) st='' if vqq==v and 'END' in v and 'BEGIN' in v: a=[] st=re.search('(BEGIN-)([\d])',v).group(2) check=re.findall('(-[\d]+)',v) while st!='END' and st not in a: a.append(st) st=re.search('({}-)((END)|[\d]+)'.format(st),v).group(2) if st=='END' and len(a)==len(check):print('GOOD') else:print('BAD')