From ec40e052f65fc3e489c8a082502c1dff09649271 Mon Sep 17 00:00:00 2001 From: alexmorenograu <61759297+alexmorenograu@users.noreply.github.com> Date: Mon, 29 Mar 2021 09:37:05 +0200 Subject: [PATCH] update regular expresions --- utilities/filter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utilities/filter.js b/utilities/filter.js index c0055f5..795947b 100644 --- a/utilities/filter.js +++ b/utilities/filter.js @@ -1,5 +1,5 @@ function isBarcode(toFilter) { - const exp = /^A0A3B82[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]$/; + const exp = /^A0A3B82[A-F0-9]{5}$/; return exp.test(toFilter); } let n = true; @@ -9,7 +9,7 @@ function isShelving(toFilter) { toFilter = Array; toFilter[0] = s; } - const exp = /^[A-Z][A-Z][A-Z]$/; + const exp = /^[A-Z]{3}$/; for (let i = 0; i < toFilter.length; i++) { let state = exp.test(toFilter[i]); if (state == false) @@ -20,6 +20,5 @@ function isShelving(toFilter) { else return true; } - exports.isBarcode = isBarcode; exports.isShelving = isShelving;