package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?mi)((?:http:\/\/+|www\.+|https:\/\/+)(?:\W+|\S+|\s+|.+)(?:\.net+|\.ro+))`)
var str = `glass shoes door window door glasses. window glasses sunglasses
glass
asdblog
{www.asdblog.iqads.net}
{http://creator.iqads.ro/NESCAFE3in1}
http://twitter.com/share
http://cdn.iqads.ro/photos/tags/11912.png
http://cluj.tecomm.ro/
http://www.godmother.ro
http://www.facebook.com/godmotherBTL
http://twitter.com/share
http://media.iqads.ro/2015/10/rm2hb-cover-400.jpg
http://media.iqads.ro/2015/09/vv-cover-800-cover-400.jpg
http://media.iqads.ro/2015/08/razvan-mitoiu-photo-cover-400.jpg
http://media.iqads.ro/2015/06/dsc7179-cover-400.jpg
http://media.iqads.ro/2015/05/raluca2-cover-400.jpg
http://media.iqads.ro/2015/05/1me-cover-400.jpg
http://cdn.iqads.ro/photos/tags/263355.png
http://cdn.iqads.ro/photos/tags/32786.png
http://cdn.iqads.ro/photos/tags/22703.png
http://cdn.iqads.ro/photos/tags/23589.png
http://cdn.iqads.ro/photos/tags/228683.png
http://cdn.iqads.ro/photos/tags/23696.png
http://cdn.iqads.ro/photos/tags/16968.png
http://cdn.iqads.ro/photos/tags/263192.png
http://www.blueidea.ro
http://www.blueidea.ro`
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/