diff --git a/src/common/string/slugify.ts b/src/common/string/slugify.ts index ddf378059cbf..b7ddfed77c90 100644 --- a/src/common/string/slugify.ts +++ b/src/common/string/slugify.ts @@ -14,7 +14,7 @@ export const slugify = (value: string, delimiter = "_") => { .toString() .toLowerCase() .replace(p, (c) => b.charAt(a.indexOf(c))) // Replace special characters - .replace(/(?<=\d),(?=\d)/g, "") // Remove Commas between numbers + .replace(/(\d),(?=\d)/g, "$1") // Remove Commas between numbers .replace(/[^a-z0-9]+/g, delimiter) // Replace all non-word characters .replace(new RegExp(`(${delimiter})\\1+`, "g"), "$1") // Replace multiple delimiters with single delimiter .replace(new RegExp(`^${delimiter}+`), "") // Trim delimiter from start of text