package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`^Name\R(.+)\REmail\R(.+)\RPhone Number\R(.+)\RInquiry or Message\R(?s)(.+)`)
var str = `Name
Troy LastName
Email
troytesting3@gmail.com
Phone Number
914 361-9012
Inquiry or Message
message as a test
to process`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
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/