mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-03 02:50:59 +08:00
## Critical Fix: Unicode Regex Escaping ### decision/engine.go - ❌ WRONG: `regexp.MustCompile(`[\u200B...]`)` (raw string, no escaping) - ✅ FIXED: `regexp.MustCompile("[\u200B...]")` (double quotes, proper Unicode) **Impact**: Backticks don't parse \uXXXX escape sequences in Go! - Raw string: matches literal text "\u200B" (useless) - Double quotes: matches Unicode characters U+200B, U+200C, U+200D, U+FEFF (correct) ### news/provider/telegram/telegram.go - Move regex patterns to global precompiled variables - Eliminates repeated compilation in stripHTML() ## Performance - Regex compilation: O(n) → O(1) - stripHTML() now uses precompiled patterns ## Testing ✅ Compilation successful ✅ Unicode characters properly matched