Replace quotes around JavaScript object properties

When pasting JSON with a lot of properties in a JavaScript file, I want to remove the double quotes around property names efficiently. How can I do it using WebStorm without deleting all quotes manually?

E.g.

{
"year": 2018,
"month": 9,
"day": 24,
"startHours": 6,
"startMinutes": 0,
}

 

should become

{
year: 2018,
month: 9,
day: 24,
startHours: 6,
startMinutes: 0,
}

2 comments

Replace (Ctrl+R) with regexp should help:

  • find "([^"]+)":
  • replace $1:


1

Please sign in to leave a comment.