package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)https?:\/\/my\.matterport\.com\/show\/\??(m=(?<code>[\w\d]+))`)
var str = `https://my.matterport.com/show/?m=kiVrPJ4GLGF&brand=0&ts=2
https://my.matterport.com/show/?m=8QLBuW5dxqB&brand=0&ts=3&help=1
https://my.matterport.com/show/?m=vycyVs9Xe9W`
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/