package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`\ndescription:\s*([^]*)`)
var str = `assignment_group: 1a29e044a527e100cd783922e1e94efb
short_description: Short text .....goes here
description: Long text goes here, line 1
and here is line 2
and line 3
right until the end - line 4
`
if len(re.FindStringIndex(str)) > 0 {
fmt.Println(re.FindString(str),"found at index",re.FindStringIndex(str)[0])
}
}
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/