package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?mi)(?<!\bsub )\btotal\b\D*(\d+(?:\.\d+))`)
var str = `Friscos #8603
8100 E. Orchard Road
Greenwood Village, Colorado 80111
2013-11-02
Table 00
Guest
1 Oysters 1/2 Shell #1
1 Crab Cake
1 Filet 1602 Bone In
1 Ribeye 22oz Bone In
1 Asparagus
1 Potato Au Gratin
$17.00
$19.00
$66.00
$53.00
$12.00
$11.50
Sub Total
Tax
$178.50
$12.94
Total
$191.44
Berghotel
Grosse Scheidegg
3818 Grindelwald
Familie R. Müller
Rech. Nr. 4572
Bar
30.07.2007/13:29:17
Tisch 7/01
NM
#ರ
2xLatte Macchiato à 4.50 CHF
1xGloki
à 5.00 CHF
1xSchweinschnitzel à 22.00 CHF
1xChässpätzli à 18.50 CHF
#ರ #ರ #1ರ
5.00
22.00
18.50
Total:
CHF
54.50
Incl. 7.6% MwSt
54.50 CHF:
3.85
Entspricht in Euro 36.33 EUR
Es bediente Sie: Ursula
MwSt Nr. : 430 234
Tel.: 033 853 67 16
Fax.: 033 853 67 19
E-mail: grossescheidegg@bluewin.ch
'
`
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/