From 8690bd722fa9cecc85fdd8c930ccb87d9582e4f3 Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Thu, 2 Mar 2023 19:40:27 +0200 Subject: [PATCH] change namings for regexp --- src/CONST.js | 2 +- src/libs/OptionsListUtils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index b36d1a7ebfcf..9e5823138368 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -785,7 +785,7 @@ const CONST = { US_PHONE_WITH_OPTIONAL_COUNTRY_CODE: /^(\+1)?\d{10}$/, DIGITS_AND_PLUS: /^\+?[0-9]*$/, PHONE_E164_PLUS: /^\+?[1-9]\d{1,14}$/, - PHONE_WITH_ANY_CHARS: /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/, + PHONE_WITH_SPECIAL_CHARS: /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/, ALPHABETIC_CHARS: /[a-zA-Z]+/, POSITIVE_INTEGER: /^\d+$/, NON_ALPHA_NUMERIC: /[^A-Za-z0-9+]/g, diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 673ac42a014d..cc45e6dad8f0 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -450,7 +450,7 @@ function getOptions(reports, personalDetails, { let recentReportOptions = []; let personalDetailsOptions = []; const reportMapForLogins = {}; - const isPhoneNumber = CONST.REGEX.PHONE_WITH_ANY_CHARS.test(searchInputValue); + const isPhoneNumber = CONST.REGEX.PHONE_WITH_SPECIAL_CHARS.test(searchInputValue); const searchValue = isPhoneNumber ? searchInputValue.replace(CONST.REGEX.NON_NUMERIC_WITH_PLUS, '') : searchInputValue; // Filter out all the reports that shouldn't be displayed