fix regex issue

This commit is contained in:
Sha Zhou 2025-08-19 17:01:04 +08:00
parent 46ee5955d3
commit 9516ce1aa6

View File

@ -251,5 +251,6 @@ function truncateInputString(input: string | Record<string, string>): string {
}
function trimLeadingSymbols(str: string): string {
return str.replace(/^(?:[\u{1F000}-\u{1F9FF}]|[\u{2600}-\u{27BF}]|[\u{FE00}-\u{FE0F}]|[\u{DFE5}]|\s)+/gu, '');
const regex = /^[\p{S}\p{P}\p{Z}\p{C}\p{Emoji}]+/u;
return str.replace(regex, '');
}