Skip to content

Commit 5b21a79

Browse files
committed
Consistent regexes
1 parent c52b73f commit 5b21a79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xlsx.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function valueOf(cell) {
6868

6969
function parseRange(specifier = ":", {columnCount, rowCount}) {
7070
specifier += "";
71-
if (!specifier.match(/^[A-Z]*[0-9]*:[A-Z]*[0-9]*$/))
71+
if (!specifier.match(/^[A-Z]*\d*:[A-Z]*\d*$/))
7272
throw new Error("Malformed range specifier");
7373
const [[c0 = 0, r0 = 0], [c1 = columnCount - 1, r1 = rowCount - 1]] =
7474
specifier.split(":").map(fromCellReference);
@@ -92,7 +92,7 @@ function toColumn(c) {
9292
// Returns the zero-based indexes from a cell reference.
9393
// For example: "A1" -> [0, 0], "B2" -> [1, 1], "AA10" -> [26, 9].
9494
function fromCellReference(s) {
95-
const [, sc, sr] = s.match(/^([A-Z]*)(\d*)$/i);
95+
const [, sc, sr] = s.match(/^([A-Z]*)(\d*)$/);
9696
let c = 0;
9797
if (sc)
9898
for (let i = 0; i < sc.length; i++)

0 commit comments

Comments
 (0)