Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 23-Jun-2021 | - | ||||
LICENSE | H A D | 23-Jun-2021 | 1.5 KiB | 28 | 24 | |
README.md | H A D | 23-Jun-2021 | 753 | 31 | 21 | |
go.mod | H A D | 23-Jun-2021 | 34 | 4 | 2 | |
go.sum | H A D | 23-Jun-2021 | 0 | |||
schemes.go | H A D | 23-Jun-2021 | 4.1 KiB | 323 | 315 | |
tlds.go | H A D | 23-Jun-2021 | 16 KiB | 1,553 | 1,544 | |
tlds_pseudo.go | H A D | 23-Jun-2021 | 836 | 25 | 13 | |
xurls.go | H A D | 23-Jun-2021 | 3.7 KiB | 107 | 83 |
README.md
1# xurls 2 3[![GoDoc](https://godoc.org/mvdan.cc/xurls?status.svg)](https://godoc.org/mvdan.cc/xurls) 4[![Travis](https://travis-ci.org/mvdan/xurls.svg?branch=master)](https://travis-ci.org/mvdan/xurls) 5 6Extract urls from text using regular expressions. Requires Go 1.10.3 or later. 7 8```go 9import "mvdan.cc/xurls/v2" 10 11func main() { 12 xurls.Relaxed().FindString("Do gophers live in golang.org?") 13 // "golang.org" 14 xurls.Strict().FindAllString("foo.com is http://foo.com/.", -1) 15 // []string{"http://foo.com/"} 16} 17``` 18 19Note that the funcs compile regexes, so avoid calling them repeatedly. 20 21#### cmd/xurls 22 23To install the tool globally: 24 25 go get -u mvdan.cc/xurls/cmd/xurls 26 27```shell 28$ echo "Do gophers live in http://golang.org?" | xurls 29http://golang.org 30``` 31