diff options
author | Ghostkeeper <rubend@tutanota.com> | 2016-10-28 14:32:49 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2016-10-28 14:33:36 +0300 |
commit | d33f6d2e44da83a4a3e655b847b835edf4e55964 (patch) | |
tree | 788bce8c1e33af38659af56d2c30f20fcacb6acb /cura | |
parent | 4ef2caddf5198cc10c04926c8289cd445d10c426 (diff) |
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.
Diffstat (limited to 'cura')
-rw-r--r-- | cura/Settings/MachineNameValidator.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cura/Settings/MachineNameValidator.py b/cura/Settings/MachineNameValidator.py index c4cab243c3..34b6351144 100644 --- a/cura/Settings/MachineNameValidator.py +++ b/cura/Settings/MachineNameValidator.py @@ -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() |