package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\G(?!^)|\"body\"\s*:\s*\")([^\",\\]*(?:\\.[^\",\\]*)*),`)
var str = `{
"url": "RETURNED URL",
"repository_url": "RETURNED URL",
"labels_url": "RETURNED URL",
"comments_url": "RETURNED URL",
"events_url": "RETURNED URL",
"html_url": "RETURNED URL",
"id": "RETURNED_ID",
"node_id": "RETURNED id",
"number": 10,
...
"author_association": "xxxx",
"active_lock_reason": null,
"body": "text \"text\" text, text text, text \\\"text text\", text, text text",
"performed_via_github_app": null
}`
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/