Quantcast
Channel: Vimタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 5717

JSONのキーが "" で囲まれてなかったときに置換した

$
0
0

こういう変なJSONぽいものがあったので、

{name:"simeji",hp:3,mp:55}

これで置換した。vimで。

:%s/\v^( +)([^" ]+)(\ +)?:/\1"\2"\3:/g

結果。

{"name":"simeji","hp":3,"mp":55}

よかったです。それだけです。


Viewing all articles
Browse latest Browse all 5717

Trending Articles