Skip to content

Commit c6b4942

Browse files
committed
Fixing regex so that it accepts decimals in the non-matrix input
1 parent 31c16b3 commit c6b4942

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readNonMat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function addConstrToArr(cj, x, elNLArr, dualCheck, noOfEmptyRows,
6161

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

0 commit comments

Comments
 (0)