diff --git a/classes/transports/modbus_base.py b/classes/transports/modbus_base.py index 3e405ff..0a1d4c9 100644 --- a/classes/transports/modbus_base.py +++ b/classes/transports/modbus_base.py @@ -105,7 +105,7 @@ def read_serial_number(self) -> str: print(sn2) print(sn3) - if not re.search("[^a-zA-Z0-9\_]", sn2) : + if not re.search("[^a-zA-Z0-9_]", sn2) : serial_number = sn2 return serial_number @@ -262,7 +262,7 @@ def analyze_protocol(self, settings_dir : str = 'protocols'): def evaluate_score(entry : registry_map_entry, val): score = 0 if entry.data_type == Data_Type.ASCII: - if val and not re.match('[^a-zA-Z0-9\_\-]', val): #validate ascii + if val and not re.match('[^a-zA-Z0-9_-]', val): #validate ascii mod = 1 if entry.concatenate: mod = len(entry.concatenate_registers)