优化正则

pull/937/head
Bakadax 2025-05-14 21:34:06 +08:00
parent 9bbab1af1e
commit 07ab913fc6
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ from ...config.config import global_config
logger = get_module_logger("chat_utils")
# 预编译正则表达式以提高性能
_LETTER_NOT_HAN_REGEX = regex.compile(r'\p{L}&^\p{Han}')
_LETTER_NOT_HAN_REGEX = regex.compile(r'[\p{L}&&\P{Han}]')
_HAN_CHAR_REGEX = regex.compile(r'\p{Han}')
def is_english_letter(char: str) -> bool: