🐛 修复(substore): 避免特征尾号和 HY2 误判

This commit is contained in:
Orion
2026-06-03 16:09:15 +08:00
parent 30e68ff3e9
commit f9e0d1146c
8 changed files with 27 additions and 10 deletions
+12 -2
View File
@@ -2,7 +2,7 @@
* Sub-Store 节点命名公共工具
*
* 远程引用地址:
* https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-5
* https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-6
*/
(function (root) {
const regexSpecialChars = new Set(['.', '*', '+', '?', '^', '$', '{', '}', '(', ')', '|', '[', ']', '\\']);
@@ -206,8 +206,18 @@
match,
prefix,
regionCode,
sequenceNumber
sequenceNumber,
offset,
input
) => {
if (
prefix === ' ' &&
offset > 1 &&
/^[A-Z]{2}$/.test(input.slice(offset - 2, offset))
) {
return match;
}
return `${prefix}${regionCode} ${sequenceNumber.padStart(2, '0')}`;
})
.replace(new RegExp(`(\\b${regionPattern} \\d{2})-\\s*(?=\\d+(?:\\.\\d+)?X\\b)`, 'g'), '$1 ')