package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)
(\d+)\t(\d+)`)
var str = `
6 9
6 10
8 11
9 12
10 13
11 14
12 15
13 16
14 17
15 18
16 19
17 20
18 21
19 22
20 23
5 24
4 25
21 26
22 27
1 28
23 29
24 30
25 31
26 32
27 33
28 34
29 35
30 36
31 37
32 38
33 39
34 40
35 41
36 42
37 43
38 44
39 45
40 46
41 47
42 48
43 49
44 50
45 51
46 52
47 53
48 54
49 55`
var substitution = "INSERT INTO loyalty_rule(rule_id_fk, loyalty_id_fk) VALUES ($1, $2);"
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/