mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 15:53:45 +08:00
fix: regex for first character matching
This commit is contained in:
parent
c4c49f61df
commit
230a0eeb64
@ -231,7 +231,8 @@ export const ProxyGroups = (props: Props) => {
|
|||||||
|
|
||||||
// 缓存getFirstChar函数
|
// 缓存getFirstChar函数
|
||||||
const getFirstChar = useCallback((str: string) => {
|
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);
|
const match = str.match(regex);
|
||||||
return match ? match[0] : str.charAt(0);
|
return match ? match[0] : str.charAt(0);
|
||||||
}, []);
|
}, []);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user