return the correct headers object

This commit is contained in:
ading2210 2024-01-18 15:00:00 -05:00
parent 563a2b7310
commit 0b14c32b25
4 changed files with 16 additions and 2 deletions

View file

@ -16,6 +16,9 @@ for fragment_file in fragments_path.iterdir():
matches = re.findall(match_regex, fragment_text, re.S)
for mode, patch_regex, patch_text, _ in matches:
fragment_matches = re.findall(patch_regex, target_text)
if not fragment_matches:
print(f"warning: regex did not match anything - '{patch_regex}'");
if mode == "DELETE":
target_text = re.sub(patch_regex, "", target_text)
elif mode == "REPLACE":