Skip to content

Commit 4c94ef4

Browse files
committed
Fix regex
1 parent 95c5af3 commit 4c94ef4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mpvqc/manager/_importer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
from mpvqc.manager import Comment
2424
from mpvqc.uiutil import replace_special_characters
2525

26-
_REGEX_PATH = re.compile("^path\s*:*\s*")
27-
_REGEX_LINE = re.compile("^\[\d{2}:\d{2}:\d{2}\]\s*\[[^\[\]]*\]\s*.*$")
26+
_REGEX_PATH = re.compile(r"^path\s*:*\s*")
27+
_REGEX_LINE = re.compile(r"^\[\d{2}:\d{2}:\d{2}\]\s*\[[^\[\]]*\]\s*.*$")
2828

2929
# Used to find the first two columns
30-
_REGEX_COLUMN = re.compile("\[[^\[\]]*\]")
30+
_REGEX_COLUMN = re.compile(r"\[[^\[\]]*\]")
3131

3232
# If a file is a valid qc document is determined if line (stripped) 1 starts with '[FILE]'.
3333
QC_DOCUMENT_HEADER = "[FILE]"

mpvqc/widgets/_commenttypeedit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, line_edit: QLineEdit, list_widget: QListWidget, button_add: Q
5454

5555
self.__line_edit = line_edit
5656
self.__line_edit.textChanged.connect(lambda txt, fun=self.__on_text_changed_line_edit: fun(txt))
57-
self.__line_edit.setValidator(QRegExpValidator(QRegExp("[^\[\]]*")))
57+
self.__line_edit.setValidator(QRegExpValidator(QRegExp("[^\\[\\]]*")))
5858

5959
self.__list_widget = list_widget
6060
self.__list_widget.selectionModel().selectionChanged.connect(

0 commit comments

Comments
 (0)