package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?:http|https):\/\/((?:[\w-]+)(?:\.[\w-]+)+)(?:[\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?`)
var str = `https://developer.mozilla.org/es/
http://www.es.pornhub.com/
http://es.cumlouder.com/?nats=MTkzOC4xLjIuMi4wLjAuMC4wLjA
http://www.pornotube.com/orientation/straight/home/page/1
http://rubias19.com/
http://www.elreyx.com/
http://www.puritanas.com/
http://www.xvideos.com/
http://es.xhamster.com/
http://www.redtube.com/
http://es.cam4.com/
https://es.chaturbate.com/
http://new.bangbros.com/home.htm
http://www.brazzers.com/home/?nats=NDc1NzAzOjQ5MzoyNA,0,0,0,0
http://www.petardas.com/
http://www.poringa.net/
http://foxtube.com/
http://www.tubewolf.com/
http://www.youporn.com/
http://www.putalocura.com/
http://www.serviporno.com/
http://www.toropornohd.com/
http://www.aztepajas.com/
http://pornfun.com/`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/