Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/transports/modbus_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down