package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?s)^(?:.*?\b(?!1p)\d+px){2}.*?\K\b(?!1p)(\d+)(px)`)
var str = `* {margin: 0; padding: 0; font-size: 12px; color: #555;}
.test {
display: inline-block;
border: 1px solid #000;
box-shadow: #aaa 4px 2px 6px;
width: 36px;
height: 24px;
}`
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/