package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)((?:^title\s*=\s*"|\G) *)([^"\s\n]+)`)
var str = `title = "What a interesting title foooooooooooo",
title= "What a boring title foo bar foo bar barfoo foobar",
title="What a crazy bar foo title",`
var substitution = "$1{$2}"
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/