package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?i)<Field name=\"Activity ID\">((.|\n)*?)</Field>`)
var str = `<?xml version="1.0" encoding="UTF-8"?>
<appointments>
<appointment>
<Field name="Activity Date">2013-11-08</Field>
<Field name="Activity Queue">546278</Field>
<Field name="Activity Status">cancelled</Field>
<Field name="Customer Name">John Smith</Field>
<Field name="Activity ID"> 1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
1-John Smith (menor)
5 (menor) 411 8
</Field> <Field name="Is a VIP">1</Field>
</appointment>
<appointment>
<Field name="Activity Date">2-013-11-08</Field>
<Field name="Activity Queue">2-546278</Field>
<Field name="Activity Status">2-cancelled</Field>
<Field name="Customer Name">2-John Smith</Field>
<Field name="Activity ID">(menor) 2- 411 8(menor)
</Field> <Field name="Is a VIP">2-</Field>
</appointment>
</appointments>
`
var substitution = "a"
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/