package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?is)site.*?\D\K(\d+\.\d{2})`)
var str = `Debit card payment to site.com
Germany
on 01 May 1.30
Debit card payment to site Germany
on 01 May 4.63
Debit card payment to site.Com
Germany
on 01 May 3.30
Debit card payment to Paypal *Xiao
Ref:- 23948 0000000000 32.98
Debit card payment to site.Com
Germany
on 20 May 17.49
Debit card refund from site.Com
Germany
on 21 May 429.29 `
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/