package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?ms)^(\d+)\. ?(.+?)(?:value|vlaue|balue|valie): ?(.+?)[\n\r]{2,}`)
var str = `Some junk data
More junk data
1. fairly long key, all on one line
value: some other text with spaces and stuff
Some junk data
More junk data
2. hey look! another long
and broken key. on two lines
value: a different value with some different information
Some junk data
More junk data
3. hey look! another long line. on a line
value: a different value
broken, with some different information
Some junk data
More junk data `
var substitution = ""
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/