package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)width=\"([^"]*)\"`)
var str = `<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2599.1307619404383!2d8.161241415866494!3d49.34967357394241!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x479648efa698cf4d%3A0xb771157caba628a8!2sMennoniten%20Branchweilerhof!5e0!3m2!1sde!2sde!4v1590230850775!5m2!1sde!2sde" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen" aria-hidden="false" tabindex="0" style="border: 0px;"></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/