ottimizzazioni

This commit is contained in:
marco
2020-06-14 20:12:48 +02:00
parent 32b9b39b29
commit f31aed8925
3 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -40,7 +40,10 @@ def printMatches(matches):
def find_single_match(data, patron, index=0):
try:
matches = re.findall(patron, data, flags=re.DOTALL)
if index == 0:
matches = re.search(patron, data, flags=re.DOTALL)
else:
matches = re.findall(patron, data, flags=re.DOTALL)
return matches[index]
except:
return ""