Skip to content

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
trin94 committed Jan 27, 2024
1 parent 95c5af3 commit 4c94ef4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mpvqc/manager/_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
from mpvqc.manager import Comment
from mpvqc.uiutil import replace_special_characters

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

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

# If a file is a valid qc document is determined if line (stripped) 1 starts with '[FILE]'.
QC_DOCUMENT_HEADER = "[FILE]"
Expand Down
2 changes: 1 addition & 1 deletion mpvqc/widgets/_commenttypeedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, line_edit: QLineEdit, list_widget: QListWidget, button_add: Q

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

self.__list_widget = list_widget
self.__list_widget.selectionModel().selectionChanged.connect(
Expand Down

0 comments on commit 4c94ef4

Please sign in to comment.