- 授权协议: BSD
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/mvdan/xurls
软件介绍
xurls 可以从纯文本中使用正则表达式提取 URL。
go get github.com/mvdan/xurls
使用示例
import "github.com/mvdan/xurls"
func main() {
xurls.Relaxed.FindString("Do gophers live in golang.org?")
// "golang.org"
xurls.Relaxed.FindAllString("foo.com is http://foo.com/.", -1)
// []string{"foo.com", "http://foo.com/"}
xurls.Strict.FindAllString("foo.com is http://foo.com/.", -1)
// []string{"http://foo.com/"}
}