Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Mura Li d77176912b Use Go1.11 module (#5743) il y a 5 ans
..
.gitignore Use Go1.11 module (#5743) il y a 5 ans
.travis.yml Use Go1.11 module (#5743) il y a 5 ans
LICENSE Use Go1.11 module (#5743) il y a 5 ans
README.md Use Go1.11 module (#5743) il y a 5 ans
go.mod Use Go1.11 module (#5743) il y a 5 ans
go.sum Use Go1.11 module (#5743) il y a 5 ans
schemes.go Use Go1.11 module (#5743) il y a 5 ans
tlds.go Use Go1.11 module (#5743) il y a 5 ans
tlds_pseudo.go Use Go1.11 module (#5743) il y a 5 ans
xurls.go Use Go1.11 module (#5743) il y a 5 ans

README.md

xurls

GoDoc Travis

Extract urls from text using regular expressions. Requires Go 1.10.3 or later.

import "mvdan.cc/xurls/v2"

func main() {
	xurls.Relaxed().FindString("Do gophers live in golang.org?")
	// "golang.org"
	xurls.Strict().FindAllString("foo.com is http://foo.com/.", -1)
	// []string{"http://foo.com/"}
}

Note that the funcs compile regexes, so avoid calling them repeatedly.

cmd/xurls

go get -u mvdan.cc/xurls/v2/cmd/xurls
$ echo "Do gophers live in http://golang.org?" | xurls
http://golang.org