package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\n1 XXXX.*(\n[2-9].*)*`)
var str = `0 @I10@ INDI
1 XXXX Alena /Boudová/
2 TYPE birth
2 GIVN Alena
2 SURN Bouda
1 SEX F
1 BIRT
2 DATE 1950
2 PLAC Dolní Lhota, Královéhradecký, Česko
3 _LOC @X866@
1 OCCU dělnice
1 FAMS @F187@
1 FAMC @F146@
1 CHAN
2 DATE 19 OCT 2015
3 TIME 20:29:06
2 _WT_USER admin
1 XXXX Alena /Kuklová/
2 TYPE married
2 GIVN Alena
2 SURN Kukl`
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/