package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^(\s*)([a-zA-Z\-\_0-9\\\/\.\s\[\]\s]*):(\s*)([a-zA-Z\-\_0-9\\\/\.]*)$`)
var str = `200 The current quota for this session are [current/limit]:
Name: testing
Quota Type: User
Per Session: False
Limit Type: Hard
Uploaded bytes: 11498900000.00/10485800000000.00
Downloaded bytes: unlimited
Transferred bytes: unlimited
Uploaded files: unlimited
Downloaded files: unlimited
Transferred files: unlimited
Please contact root@0.0.0.0 if these entries are inaccurate`
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/