package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?is)\b(?'verb'build|make|implementing)\s*
(?'build'(?:(?!(?&verb)).)*?)
(?=\s*\b(?:in|on)\b)
`)
var str = `Projects I've built & Plan to build. HackMatch.io (May 2020 onward), As of October 2020, I intend to start implementing "Natural Language Processing" algorithms in PHP when I have time. I'll then use PHP to upload the results to big data tech (e.g. BigQuery) to create some data visualizations.`
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/