package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?i)\/o\/([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)`)
var str = `https://firebasestorage.googleapis.com/v0/b/geographical-memories-dev.appspot.com/o/Fa4NPIoM5sON70uDJjufgnL5DHY2/01792dcc-4963-4658-a3d0-99073b352e22?alt=media&token=23676a66-ed8d-4b43-9150-6ef3f07544f0
https://firebasestorage.googleapis.com/v0/b/geographical-memories-dev.appspot.com/o/Fa4NPIoM5sON70uDJjufgnL5DHY2/01792dcc-4963-4658-a3d0-99073b352e22?alt=media&token=80a5cc0f-7943-4ef8-ab00-9bef8acd41bf`
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/