mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Make regex match exactly on entire string
The carot indicates start of string, the dollar the end of string. So it must match on the entire string, not a piece of it. Contributes to issue CURA-2692.
This commit is contained in:
parent
4ef2caddf5
commit
d33f6d2e44
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ class MachineNameValidator(QObject):
|
||||||
# special character, and that up to [machine_name_max_length / 12] times.
|
# special character, and that up to [machine_name_max_length / 12] times.
|
||||||
maximum_special_characters = int(machine_name_max_length / 12)
|
maximum_special_characters = int(machine_name_max_length / 12)
|
||||||
unescaped = r"[a-zA-Z0-9_\-\.\/]"
|
unescaped = r"[a-zA-Z0-9_\-\.\/]"
|
||||||
self.machine_name_regex = r"((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}"
|
self.machine_name_regex = r"^((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}$"
|
||||||
|
|
||||||
validationChanged = pyqtSignal()
|
validationChanged = pyqtSignal()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue