Skip to content

Commit

Permalink
Fixing regex so that it accepts decimals in the non-matrix input
Browse files Browse the repository at this point in the history
  • Loading branch information
fusion809 committed Aug 3, 2021
1 parent 31c16b3 commit c6b4942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readNonMat.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function addConstrToArr(cj, x, elNLArr, dualCheck, noOfEmptyRows,

// Obtain coeff of x[i] for constraint j
var varName = x[i];
var regex = new RegExp(`[+-]*[0-9/]*${varName}`);
var regex = new RegExp(`[+-]*[0-9./]*${varName}`);
if (constrLHS.match(regex)) {
var coeff = constrLHS.match(regex).join("").replace(varName, "");
if (!coeff.match(/[0-9]/)) {
Expand Down

0 comments on commit c6b4942

Please sign in to comment.