package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?ms)BEGIN:VEVENT.*?END:VEVENT`)
var str = `BEGIN:VEVENT
DTSTAMP:20220301T023567Z
UID: xxx
DTSTART;TZID=Asia/Tokyo:20210630T110000
DTEND;TZID=Asia/Tokyo:20210630T160000
DESCRIPTION:\n--------\n同日入替 : false\n前回ゲスト数 : 1\n次
SUMMARY: xxxxx (xxx / xxx xxx
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20221105T072143Z
UID: xxx
DTSTART;TZID=Asia/Tokyo:20210501T110000
DTEND;TZID=Asia/Tokyo:20210701T160000
DESCRIPTION:\n--------\n同日入替 : false\n前回ゲスト数 : 1\n次
SUMMARY: xxx (xxx / xxx xxx)
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20220905T023143Z
UID: xxx
DTSTART;TZID=Asia/Tokyo:20220227T110000
DTEND;TZID=Asia/Tokyo:20220227T160000
DESCRIPTION:\n--------\n同日入替 : true\n前回ゲスト数 : 2\n次回
SUMMARY:★ xxx (xxx / xxx xxx)
END:VEVENT`
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/