diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index 78e74f1c..f984b99c 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1163,15 +1163,22 @@ public static class ConfigHandler return 0; } - private const string PolicyGroupDefaultAllFilter = "^(?!.*(?:剩余|过期|到期|重置)).*$"; + // Matches subscription-info noise words in both Chinese and English. + // Chinese: 剩余(remaining), 过期/到期(expired/expiry), 重置(reset) + // English: remaining, expir(e/ed/y), reset + private const string PolicyGroupExcludeKeywords = @"剩余|过期|到期|重置|[Rr]emaining|[Ee]xpir|[Rr]eset"; + + private const string PolicyGroupDefaultAllFilter = $"^(?!.*(?:{PolicyGroupExcludeKeywords})).*$"; /// /// Combines a region pattern with PolicyGroupDefaultAllFilter so results must - /// match the region keyword AND not contain expiry/traffic noise words. - /// Result pattern: ^(?!.*(?:剩余|过期|到期|重置)).*(?:regionPattern).*$ + /// match the region keyword AND not contain expiry/traffic noise words (CN + EN). + /// Result pattern: ^(?!.*(?:...excludeKeywords...)).*(?:regionPattern).*$ /// private static string CombineWithDefaultAllFilter(string regionPattern) - => $"^(?!.*(?:剩余|过期|到期|重置)).*(?:{regionPattern}).*$"; + { + return $"^(?!.*(?:{PolicyGroupExcludeKeywords})).*(?:{regionPattern}).*$"; + } /// /// Create a group server that combines multiple servers for load balancing