package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)src=(["'])(?<url>(?:https?:)?\/\/(?:(?!\1).)*?)\1`)
var str = `<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="800" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FuZVQhh9JQIziU1cSg3CSne%2FRich-Text-and-Embed-Dev%3Fnode-id%3D101%253A8445" allowfullscreen></iframe>`
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/