package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`{[a-z]+:ce_img:(?:single|pair)?([\w\W\s]+)*}`)
var str = `{eggs:ce_img:single
src="{src}"
fallback_src="/assets/a-b-c.jpg"
width="250"
height="250"
add_dims="no"
crop="yes"
title="{title}"
alt="{title}"
allow_scale_larger="yes"
}`
var substitution = "$1"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/