package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`\/\/==start==\n(.+\n)*\/\/==end==`)
var str = `var originalString = \`// @Author: someone
// @Date: 2018-01-23T16:46:09-04:00
// @Email: dddddddd@gmail.com
// @Filename: _material.themes.scss
// @Last modified by: Someone
// @Last modified time: 2018-01-23T18:40:39-04:00
@include angular-material-theme($theme);
.app-dark {
@include angular-material-theme($dark-theme);
}
.app-pink {
@include angular-material-theme($pink-theme);
}
//==start==
//==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/