package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m).*\/profile\/documents\/[a-f\d]{8}-[A-f\d]{4}-4[A-f\d]{3}-[89ab][a-f\d]{3}-[a-f\d]{12}$`)
var str = `http://localhost:3000/profile/documents/8ce825b7-b8c2-468b-a4c8-88eedea5b4c2
http://127.0.0.1/49943/profile/documents/8ce825b7-b8c2-468b-a4c8-88eedea5b4c2`
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/