feat: 更新正则位置

This commit is contained in:
huangzhe
2025-07-31 15:31:01 +08:00
parent 1f6bf9a865
commit e01ce128db

View File

@@ -92,14 +92,16 @@ export default {
// 如果开头是中文,直接返回
if (new RegExp('^[\u4e00-\u9fa5]+', 'g').test(text)) return text
text = text.replace(/<information>([^<]*)(?:<\/information>)?/g, '')
text = text.replace(/<is_complete>([^<]*)(?:<\/is_complete>)?/g, '')
// 捕获 不包含 < 的后置标签 span> /span> a</span>
text = text.replace(/^[/]?[a-zA-z0-9]+[</\w>]+/g, '')
// 尝试匹配 </abc> 标签
text = text.replace(/^<\w+>/g, '')
// <\/?([\w\s]+)?(?!>)$
text = text.replace(/<\/?([\w\s='"]+)?(?!>)$/g, '')
text = text.replace(/<information>([^<]*)(?:<\/information>)?/g, '')
text = text.replace(/<is_complete>([^<]*)(?:<\/is_complete>)?/g, '')
text = text.replace(/^\w+/, "")
return text
// }