package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^[\d.]+(?:.|[\r\n])*?(?=[.\x20\t]+\d{2,3}$)`)
var str = `5.2 Initializing the I/O Base Registers ................................. 51
5.3 Hiding and Function Disable troller Hub (PCH) Internal Devices 52
5.3.1 Fuse Disabled, Static Disabled, Non-Static Function Disable Device
Handling ................................................................. 53
8.4 SERR# Generation .................................................. 102
8.5 PCI Firmware Spec 3.0 Support ..................................... 103
8.6 ACPI Table and Methods for PCI Express* Support ................... 103
`
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/