package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(\d){1}\t\t(\d){1,3}\%\s\t(\d){1}\t(\d){1,3}\%`)
var str = `Current car character
Power Handling Acceleration
102 107 104
Car character points history
Car part Level Action Wear New level New wear
Chassis: 6 96% 6 96%
Engine: 7 100% 7 100%
Front wing: 8 70% 8 70%
Rear wing: 8 75% 8 75%
Underbody: 8 63% 8 63%
Sidepods: 8 91% 8 91%
Cooling: 8 80% 8 80%
Gearbox: 7 82% 7 82%
Brakes: 9 25% 9 25%
Suspension: 8 94% 8 94%
Electronics: 8 78% 8 78%
(\d){1}\t\t(\d){1,3}\%\s\t(\d){1}\t(\d){1,3}\%`
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/