From cc5890f13691eab41e3a99b60bebd6acf01fd2c6 Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Wed, 24 Jul 2024 14:26:15 -0700 Subject: [PATCH] change penLocalIdName regex --- backend/src/components/studentFilters.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/components/studentFilters.js b/backend/src/components/studentFilters.js index a39d9fb2..4b898362 100644 --- a/backend/src/components/studentFilters.js +++ b/backend/src/components/studentFilters.js @@ -113,12 +113,12 @@ function createMoreFiltersSearchCriteria(searchFilter = []) { // pValue consists only of numbers let penCriteria = createLocalIdPenSearchCriteria(pValue.toString()); penLocalIdNameFilter.push(...penCriteria); - } else if (/^[a-zA-Z]+$/.test(pValue)) { - // pValue consists only of alphabetical characters + } else if (/^[a-z\-.'\s]+$/i.test(pValue)) { + // pValue consists only of alphabetical characters and allowed name characters let nameCriteria = createMultiFieldNameSearchCriteria(pValue.toString()); penLocalIdNameFilter.push(...nameCriteria); - } else if (/^[a-zA-Z0-9]+$/.test(pValue)) { - // pValue contains both numbers and alphabetical characters + } else { + // pValue contains both numbers and alphabetical characters or unknown characters let nameCriteria = createMultiFieldNameSearchCriteria(pValue.toString()); let penCriteria = createLocalIdPenSearchCriteria(pValue.toString()); penLocalIdNameFilter.push(...nameCriteria, ...penCriteria);