package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?ms)^Name:(?:(?!Name:|-).)+-\d+ Days(?:(?!Name:|-).)+(?=Name:|\z)`)
var str = `Name: John Smith
Address: 123 Sample Road
Country: England
Membership Expires: January 26, 2023, 9:35 am -288 Days
Plan: Platinum
Payment Method: American Express
Name: Paul Mitchell
Address: 911 Unknown Road Country: USA
Membership Expires: October 7, 2024, 10:23 am 331 Days
Plan: Gold
Payment Method: Visa
Name: David Beckham
Address: 666 Example Road
Country: Scotland
Membership Expires: August 30, 2023, 6:03 pm -72 Days
Plan: Silver
Payment Method: Mastercard
Name: Frank Bruno
Address: 999 Random Road
Country: France
Membership Expires: April 19, 2024, 10:41 pm 160 Days
Plan: Bronze
Payment Method: PayPal
`
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/