unit-mesh / auto-dev

🧙‍AutoDev: The AI-powered coding wizard(AI 驱动编程助手)with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀
https://ide.unitmesh.cc/
Mozilla Public License 2.0
2.79k stars 318 forks source link

tryFixHostUrl 方法的正则表达式疑似错误 #98

Closed iptton closed 7 months ago

iptton commented 8 months ago
fun isUrlWithPath(input: String): Boolean {
            val urlPattern = Regex("^https?://[a-zA-Z0-9-]+(\\\\.[a-zA-Z]{2,})+(/[a-zA-Z0-9-._~:/?#[\\\\]@!\$&'()*+,;=%]*)?\\\$")
            return urlPattern.matches(input)
        }

typo?

"https://example.com/path/to/resource?query=param#fragment" 是通过不了这个正则的,这个方法会在 url 后添加 "/"

phodal commented 8 months ago

应该是,来 PR?