package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`("name":"[^"]+")|("price":(?:\d{1,3}.?)+[.,]\d{1,2})`)
var str = `[{"productsShelf":[],"productsDetail":[{"position":"1","name":"Placa-M�e ASUS p/ Intel LGA 1151 ATX ROG STRIX Z270E GAMING,DDR4,Aura Sync, �udio Gamer, Rede Intel, SLI/CFX, Wi-Fi, USB 3.1 Frontal,HDMI/DP","category":"Hardware/Placas-m�e/P/ Processador Intel/ASUS","brand":"Asus;","price":1095.9,"id":"84264","available":true}],"visitor":"","pageType":"product","breadcrumb":[{"url":"http://www.kabum.com.br/hardware","name":"Hardware"},{"url":"http://www.kabum.com.br/hardware/placas-mae","name":"Placas-m�e"},{"url":"http://www.kabum.com.br/hardware/placas-mae/p-processador-intel","name":"P/ Processador Intel"},{"url":"http://www.kabum.com.br/hardware/placas-mae/p-processador-intel/asus","name":"ASUS"}]}];`
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/