import re
regex = re.compile(r"(\"name\":\"[^\"]+\")|(\"price\":(?:\d{1,3}.?)+[.,]\d{1,2})")
test_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\"}]}];"
matches = regex.finditer(test_str)
for match_num, match in enumerate(matches, start=1):
print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}")
for group_num, group in enumerate(match.groups(), start=1):
print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")
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 Python, please visit: https://docs.python.org/3/library/re.html