package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(https?://(?![^\s\/]+youtu)[^\s\)\]?]+)\?([^\s\)\]?]{20,})`)
var str = `https://www.aliexpress.com/item/4000050337687.html?spm=a2g0o.productlist.0.0.70c9492bADfZA5&algo_pvid=66a91537-1872-4a3b-ab39-e9d130970423&algo_exp_id=66a91537-1872-4a3b-ab39-e9d130970423-0&pdp_ext_f=%7B%22sku_id%22%3A%2210000003069527876%22%7D&pdp_npi=2%40dis%21EUR%2118.03%2114.07%21%21%21%21%21%402100bdd816603176696127137ebeac%2110000003069527876%21sea&curPageLogUid=8f5jqvWtAYMa`
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/