package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(.*)(?:http:\/\/thepaperwall\.com\/wallpapers\/.*\.jpg)(.*)`)
var str = `test test http://thepaperwall.com/wallpapers/cityscape/small/small_642331afcd78d0840485bb352d99b289b50e8467.jpg test test `
if len(re.FindStringIndex(str)) > 0 {
fmt.Println(re.FindString(str),"found at index",re.FindStringIndex(str)[0])
}
}
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/