From 230a0eeb64716def8069d96c7fa1d5efd322587c Mon Sep 17 00:00:00 2001 From: wonfen Date: Fri, 7 Mar 2025 14:07:10 +0800 Subject: [PATCH] fix: regex for first character matching --- src/components/proxy/proxy-groups.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/proxy/proxy-groups.tsx b/src/components/proxy/proxy-groups.tsx index adec9da7..d59c0790 100644 --- a/src/components/proxy/proxy-groups.tsx +++ b/src/components/proxy/proxy-groups.tsx @@ -231,7 +231,8 @@ export const ProxyGroups = (props: Props) => { // 缓存getFirstChar函数 const getFirstChar = useCallback((str: string) => { - const regex = /\p{Extended_Pictographic}|\p{L}|\p{N}|./u; + const regex = + /\p{Regional_Indicator}{2}|\p{Extended_Pictographic}|\p{L}|\p{N}|./u; const match = str.match(regex); return match ? match[0] : str.charAt(0); }, []);