mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 05:09:06 +08: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
@ -28,7 +28,7 @@ class MachineNameValidator(QObject):
|
||||
# special character, and that up to [machine_name_max_length / 12] times.
|
||||
maximum_special_characters = int(machine_name_max_length / 12)
|
||||
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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user