package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(.*)\|[\s\t]+([0-9.,]+|)([\s\t]+|)\|(.*)`)
var str = `02.05.07| 158.73 |test1
02.05.07| 63,492.00|test2
| |Взнос наличными на счет
| |@@CP 00442 XXXXXXXXXXXXXX
| |КАРАГАНДИНСКИЙ Ф-Л
| |счет : 1101-879100-398
| |СЧЕТ КАССЫ
| |/KNP/1717311
| |ПОПОЛ СЧ ДОВ 322 ОТ 22,12,06 Ч/З КО
| |ЗЫРЯД
`
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/