package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\s+[^.!?]*[.!?]){1} (?:\A|(?<=.))[^.]*(Apple|эппл)[^.]*(?:.|\Z)(\s+[^.!?]*[.!?]){2}`)
var str = `As I discussedasdasd.
As I discussed in my tutorial on how to extract tables from PDFs, PDFs are notoriously difficult to scrape. It's much easier to scrape XXX a text file, so I recommend converting your Apple goo PDFs to text files, which I explained how to do in*K this tutorial, and scraping those. In the following, Apple squirrel John I will эппл describe how to use re, the Python regular expressions library, to scrape text files. As I discussed in my tutorial on how to extract tables from PDFs, PDFs are notoriously difficult to scrape. And then find smth new.`
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/