From ea62f2443f7ebe8bccfbaefd7e533e6860cbd877 Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:35:31 +0200 Subject: [PATCH] [bugfix-517] use regex.exec instead of .match --- src/shared/helpers/string.helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/helpers/string.helpers.ts b/src/shared/helpers/string.helpers.ts index 91120a7f..56649c4c 100644 --- a/src/shared/helpers/string.helpers.ts +++ b/src/shared/helpers/string.helpers.ts @@ -8,6 +8,6 @@ export function findHashInString(str: string, algorithm: keyof typeof HashAlgori const hashLength = HashAlgorithmsLengths[algorithm]; const regex = new RegExp(`[a-fA-F0-9]{${hashLength}}`, "g"); - const match = str.match(regex); + const match = regex.exec(str); return match ? match[0] : undefined; }