Skip to content

Commit 5ce5b9e

Browse files
committed
Improves tag escaping for special characters
Refines the regular expression to more accurately escape all special characters in tags, ensuring better compatibility with Redis search and query operations.
1 parent 8f7e557 commit 5ce5b9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/redis/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ export const Redis = (() => {
4343

4444
// reference: https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/escaping/
4545
export const escapeTag = (tag?: string) =>
46-
tag?.replace(/[,.<>{}[]"':;!@#$%^&*()-+=~]/g, '\\$&')
46+
tag?.replace(/([,.<>:{}"'/\\|?!@#$%^&*()\-+=[\]`~])/g, '\\$1')

0 commit comments

Comments
 (0)