【发布时间】:2015-11-28 12:14:15
【问题描述】:
我想使用 sublime 在我的 json 中查找和删除“indicent”对象。这是正则表达式
\s*+,\s*(.)+"\s*indices+"\s*:\s*+(.)\s*\s*(.)+\s*(.)+\s*+]
但是,它的堆栈空间用完了。我认为正则表达式效率不高。
json 示例:
"created": "Fri Nov 27 11:12:43 +0000 2015",
"text": "https://t.co/8r5dQ7zRYG #johnl3375 Kim Gi Jung",
"source": "NOMOR1",
"hashtags": [
{
"text": "johnl3375",
"indices": [
24,
34
]
}
],
"url": [
{
"url": "https://t.co/8r5dQ7zRYG",
"expanded_url": "https://play.google.com/store/apps/details?id=com.aturkeuangan.nomor1#refid=johnl3375",
"display_url": "play.google.com/store/apps/det…",
"indices": [
0,
23
]
}
]
我想要这样的json
"created": "Fri Nov 27 11:12:43 +0000 2015",
"text": "https://t.co/8r5dQ7zRYG #johnl3375 Kim Gi Jung",
"source": "NOMOR1",
"hashtags": [
{
"text": "johnl3375"
}
],
"url": [
{
"url": "https://t.co/8r5dQ7zRYG",
"expanded_url": "https://play.google.com/store/apps/details?id=com.aturkeuangan.nomor1#refid=johnl3375",
"display_url": "play.google.com/store/apps/det…"
}
]
我的正则表达式应该是什么?
【问题讨论】:
标签: json regex sublimetext3