[英]Regex in ruby to enclose word before : with double quotes
我有一個要轉換為json字符串的字符串
以下是json的格式
title: {
position: "bottom",
text: "Share of Internet Population Growth"
},
legend: {
visible: false
},
chartArea: {
background: ""
},
seriesDefaults: {
type: "donut",
startAngle: 150
}
要將其轉換為JSON字符串,我需要將AnyKey:
替換為"AnyKey":
我在讀有關gsub的文章。 什么是確切的正則表達式來替換這種字符串
提前致謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.