package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?:.+(?:\/|%2F))+?([^\/]+\.jpg)(?=\?)`)
var str = `https://firebasestorage.googleapis.com/v0/b/work-52105.appspot.com/o/user%2FwCBsmRGAxbMQXO2yqc8jF65pmIG3%2FDepositphotos_59984669_s-2015.jpg?alt=media&token=916f8bb6-2ccf-4a95-b76b-814db081c028`
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/