From 742f45da7b9985b2526bd211154f6b7713fd13b5 Mon Sep 17 00:00:00 2001 From: Timon Stegmaier Date: Tue, 12 Nov 2024 14:54:16 +0100 Subject: [PATCH] fix: added r in front of regex strings --- cellacdc/widgets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cellacdc/widgets.py b/cellacdc/widgets.py index e2df37aa..dc7ff021 100755 --- a/cellacdc/widgets.py +++ b/cellacdc/widgets.py @@ -955,14 +955,14 @@ def keyPressEvent(self, event) -> None: def onTextChanged(self, text): IDs = [] - rangesMatch = re.findall('(\d+-\d+)', text) + rangesMatch = re.findall(r'(\d+-\d+)', text) if rangesMatch: for rangeText in rangesMatch: start, stop = rangeText.split('-') start, stop = int(start), int(stop) IDs.extend(range(start, stop+1)) - text = re.sub('(\d+)-(\d+)', '', text) - IDsMatch = re.findall('(\d+)', text) + text = re.sub(r'(\d+)-(\d+)', '', text) + IDsMatch = re.findall(r'(\d+)', text) if IDsMatch: for ID in IDsMatch: IDs.append(int(ID)) @@ -2129,7 +2129,7 @@ class NumericCommaLineEdit(QLineEdit): def __init__(self, parent=None): super().__init__(parent) - self.validPattern = '^[0-9,\.]+$' + self.validPattern = r'^[0-9,\.]+$' regExp = QRegularExpression(self.validPattern) self.setValidator(QRegularExpressionValidator(regExp)) @@ -8366,7 +8366,7 @@ def fixParagraphTags(self, texts): continue if text.find('

') == -1: - text = f'{text}<\p>' + text = rf'{text}<\p>' if text.find(openTag) == -1: text = f'{openTag}{text}'