package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`\W\K(?|(?=(your|her|his|its|our|their|mine|yours|hers|ours|theirs|my|a|an|the)\b)()|(\w+|\*)\b)\s+\b(bore|bade|bit|blew|chose|dove|drew|drove|drank|ate|fell|forbade|forgot|forgave|forsook|froze|got|gave|went|grew|hid|knew|lay|lit|mistook|overdid|overtook|overthrew|rode|rang|rose|saw|shook|shore|shrank|sang|sank|smote|spoke|stole|stank|strod|strove|swore|swam|took|threw|trod|woke|wore|wove|wrote)\b(?=\s)`)
var str = `1) And Ôhe spoke to him
2) and spoke to his sons
3) his host, spoke to
4) and took of every
5) and * took a garment
6) And * took * his son
7) merchants fetched a drove of horses
8) ÔI am a rose
9) blossom like a rose
10) But a † rose out
11) that * rose up
12) and a bit
13) and Ôthey bit the people`
var substitution = "$1 - $2 - $3 - "
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/