From 8cd5abe2e18471fb85d47039e74a2544bf8c3250 Mon Sep 17 00:00:00 2001 From: Tombula Date: Mon, 15 Sep 2025 19:04:41 +0200 Subject: [PATCH] extend regex expressions for negative profile params --- js/control/Profile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/control/Profile.js b/js/control/Profile.js index ccc9c61f..cfb8f521 100644 --- a/js/control/Profile.js +++ b/js/control/Profile.js @@ -97,7 +97,7 @@ BR.Profile = L.Evented.extend({ const profileText = this._getSelectedProfileText(); if (!profileText) return value; - const regex = new RegExp(`assign\\s*${name}\\s*=?\\s*([\\w\\.]*)`); + const regex = new RegExp(`assign\\s*${name}\\s*=?\\s*(-?[\\w\\.]*)`); const match = profileText.match(regex); if (match) { value = match[1]; @@ -143,7 +143,7 @@ BR.Profile = L.Evented.extend({ var re = new RegExp( '(assign\\s*' + name + - '\\s*=?\\s*)([\\w.]*)(\\s*#\\s*%(.*)%\\s*(\\|\\s*(.*)\\s*\\|\\s*(.*)\\s*)?[\\r\\n])' + '\\s*=?\\s*)(-?[\\w.]*)(\\s*#\\s*%(.*)%\\s*(\\|\\s*(.*)\\s*\\|\\s*(.*)\\s*)?[\\r\\n])' ); profileText = profileText.replace(re, function (match, p1, p2, p3) { return p1 + value + p3; @@ -233,7 +233,7 @@ BR.Profile = L.Evented.extend({ global = global[0].split('\n').slice(1); // Comment is mandatory - var assignRegex = /assign\s*(\w*)\s*=?\s*([\w\.]*)\s*#\s*%(.*)%\s*(\|\s*(.*)\s*\|\s*(.*)\s*)?$/; + var assignRegex = /assign\s*(\w*)\s*=?\s*(-?[\w\.]*)\s*#\s*%(.*)%\s*(\|\s*(.*)\s*\|\s*(.*)\s*)?$/; global.forEach(function (item) { var match = item.match(assignRegex); var value;