package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)"Id":"(?<campid>.*?)","Status":"(?<status>.*?)","Five9__Five9list__c":"(?<five9list>.*?)"}]}`)
var str = `{"searchRecords":[{"attributes":{"type":"Campaign","url":"/services/data/v43.0/sobjects/Campaign/701C0000000sVOVIA2"},"Id":"701C0000000sVOVIA2","Status":"Planned","Five9__Five9list__c":"Toast_list_outbound"}]}`
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/