From f991abf7ea97d9c84c73e6f8948bd59d2581b449 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 10 Sep 2023 09:51:48 +0200 Subject: [PATCH] Small regex tidyup for 3.11 --- changedetectionio/processors/text_json_diff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changedetectionio/processors/text_json_diff.py b/changedetectionio/processors/text_json_diff.py index fb810f0c..0ae4aca0 100644 --- a/changedetectionio/processors/text_json_diff.py +++ b/changedetectionio/processors/text_json_diff.py @@ -38,15 +38,15 @@ class perform_site_check(difference_detection_processor): self.datastore = datastore # Doesn't look like python supports forward slash auto enclosure in re.findall - # So convert it to inline flag "foobar(?i)" type configuration + # So convert it to inline flag "(?i)foobar" type configuration def forward_slash_enclosed_regex_to_options(self, regex): res = re.search(r'^/(.*?)/(\w+)$', regex, re.IGNORECASE) if res: regex = res.group(1) - regex += '(?{})'.format(res.group(2)) + regex = f"(?{res.group(2)}){regex}" else: - regex += '(?{})'.format('i') + regex = f"(?i){regex}" return regex