package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`width="(\d+)(px)?"`)
var str = `│Арт │ Имя │Количество │Зак.цена │
├──────────┼───────────────────────────────────────────────┼───────┼─────────┤
<img width="30" height="auto" src="/descriptions/models/michelin/PilotSport5/40.jpg" class="pic_left">
<img width="30px" height="auto" src="/descriptions/models/michelin/PilotSport5/40.jpg" class="pic_left">`
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/