1

I have some objects like this:

"unit":{
          "id":"1",
          "title":"I am a title",
          "description":" description",
          "category":{
            "name":"Reading",
            "type":"READING",
            "icon":"fas fa-book"
}

I'd like to remove the double quotes from the keys. Is there a good way to do this in regex? I use: ".*": to match the key's, but am unsure of how to do the partial replace in VSCode. I tried this solution, but was unsuccessful.

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
J.spenc
  • 339
  • 2
  • 3
  • 11

1 Answers1

1

You can use

"([^"]+)":

Replace with $1:. Details:

  • " - a double quote
  • ([^"]+) - Group 1 ($1 refers to the this group value): any one or more chars other than "
  • ": - a ": string.
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563