package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(\d+.\d+) "([\w]+)`)
var str = ` "Title: Y"
"Method: Mass-loaded (1.500 grams)"
"DCR mode: Measure (-0.07 ohms)"
"Area (Sd): 12.88 sq cm"
"QC-limits file: "
"Last setup file: C:\MLS\SPO-W.SET modified "
"Series resistance: 75.00 ohms"
"Stimulus level: 4.08 volts"
"SPLref reference impedance: NONE"
"Large units (volume = liters, mass = grams)"
0.169 "RMSE-free Ohms"
202.854 "Fs Hz"
3.473 "Re Ohms[dc]"
23.567 "Res Ohms"
6.487 "Qms "
0.956 "Qes "
0.833 "Qts "
0.065 "L1 mH"
0.058 "L2 mH"
0.827 "R2 Ohms"
0.130 "RMSE-load Ohms"
0.092 "Vas(Sd) liters"
1.551 "Mms grams"
396.893 "Cms �M/Newton"
2.680 "Bl Tesla-M"
80.900 "SPLref(Sd) dB "
0.043 "Rub-index "
`
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/