package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<=card setlment).*(?=-)(.*)`)
var str = `
cb-lt
For 2020-12-08/12/3/3
dec tue
Name ID shoping company shop gold Net Fees Net
card card card card
------------------------------------------------------------------------------------------------------------------------
smantha 5 78952 .00 366410.00 0.00 30800.00 -586.65 -471656.65
kamnthi 7 99999.00 0.00 0.00 0.00 0.00 -5800.00
nimali 8 8888888.00 587960.15 0.00 741985.00 -784.35 509027.80
card setlment 4568153.37 2325802.00 3298.00 175882.41 -3049.24 -577589
1
`
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/