package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<![0-9])([0-9]{1,2}?)([0-9]{3})(?![0-9]+?)`)
var str = `Lorem 100 ipsum dolor 1000 sit 200 amet, 2000 consectetur adipiscing elit, sed 20000 do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in 300 voluptate 3000 velit esse 30000 cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat 400 cupidatat 4000 non proident, 40000 sunt in culpa qui officia deserunt mollit anim id est laborum.`
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/