package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)(?<!stay )short`)
var str = `Our system's recommendation today is to STAY SHORT. The previous SHORT signal was issued on 30.08.2018, 1 day ago, when the stock price was 43.9250. Market attention is now on the downside. SHORT is a dangerous signal. Sudden increases in prices can lead to huge losses. For this reason stop loss levels must be kept in mind at all times and SHORT orders must never be placed without a stop loss`
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/