Skip to content

Commit

Permalink
fix: added r in front of regex strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Teranis committed Nov 12, 2024
1 parent b37db8e commit 742f45d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cellacdc/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -8366,7 +8366,7 @@ def fixParagraphTags(self, texts):
continue

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

if text.find(openTag) == -1:
text = f'{openTag}{text}'
Expand Down

0 comments on commit 742f45d

Please sign in to comment.