package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<=Value=).*?(?=})`)
var str = `{[Response[attributes={Status=Success, action=Retrieve}; value=[NameList[attributes={PropertyName=Name}; value=[Names[attributes={}; value=[SimplePair[attributes={Key=-, Value=-}; value=[]], SimplePair[attributes={Key=Preferences, Value=Preferences}; value=[]], SimplePair[attributes={Key=&DEFAULT_PREFERENCE, Value=Default}; value=[]], SimplePair[attributes={Key=Profile, Value=Profile}; value=[]], SimplePair[attributes={Key=Duty Manager, Value=Duty Manager}; value=[]], SimplePair[attributes={Key=Mode User, Value=Mode User}; value=[]], SimplePair[attributes={Key=ModeDisplay Profile, Value=Mode Display Profile}; value=[]], SimplePair[attributes={Key=Mode Manager, Value=Mode Manager}; value=[]], SimplePair[attributes={Key=Professional Employees, Value=Professional Employees}; value=[]], SimplePair[attributes={Key=Scheduler, Value=Scheduler}; value=[]], SimplePair[attributes={Key=Super Access, Value=Super Access}; value=[]], SimplePair[attributes={Key=keeper, Value=keeper}; value=[]], SimplePair[attributes={Key=Manager, Value=Manager}; value=[]]]]]]]]]}`
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/