Use api package regexes

This commit is contained in:
Eric Bailey
2023-10-24 09:49:13 -05:00
parent ee3d1ff40d
commit c5005958f0
7 changed files with 33 additions and 34 deletions
-7
View File
@@ -1,10 +1,3 @@
export const TAG_REGEX =
/(?:^|\s)(#[\p{L}\p{Emoji_Presentation}\p{Emoji_Modifier_Base}\p{Extended_Pictographic}]{1}[\p{L}\p{Emoji_Presentation}\p{Emoji_Modifier_Base}\p{Extended_Pictographic}\d_-]*)/giu
export const LOOSE_TAG_REGEX =
/(?:^|\s)(#[\p{L}\p{Emoji_Presentation}\p{Emoji_Modifier_Base}\p{Extended_Pictographic}]{1}[\p{L}\p{Emoji_Presentation}\p{Emoji_Modifier_Base}\p{Extended_Pictographic}\d_-]*\S*)/giu
export const ENDING_PUNCTUATION_REGEX = /\p{P}+$/gu
export const LEADING_HASH_REGEX = /^#/g
export function sanitize(tagString: string) {
return tagString
.trim()