package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?s)PAS_BEGIN_0009999(.*?)PAS_END_0009999`)
var str = `PAS_BEGIN_0009999
T71_MANUFACTURER_4=98
T71_COLOR_ID_7=000
T71_OS_7=08
PAS_END_0009999
PAS_BEGIN_0009996
T72_VAS_SERVICE_IDENTIFIER_6=
T72_ORDER_NB_7=0003
T72_TECHNOLOGY_7=01
PAS_END_0009996
TPV_BEGIN
PAS_20819001=3600000
TPV_END`
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/