Skip to content
Open
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
6 changes: 3 additions & 3 deletions js/control/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down