VS Code Search and Regex/Convert key: value style to quoted keys

Useful when massaging JS-like objects into JSON-like keys.

Section: Replace Cookbook

Convert key: value style to quoted keys

regex
regex
Find: ^\s*(\w+)\s*:
Replace: "$1":

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Replace Cookbook
Replace repeated spaces with one
Normalize spacing.
OpenIn sheetregexsame section
Wrap matches in quotes
Surround found words using capture groups.
OpenIn sheetregexsame section
Prefix lines during replace
Insert comment prefix at the beginning of lines.
OpenIn sheetregexsame section
Collapse repeated blank lines
Reduce multiple blank lines to one.
OpenIn sheetregex2 tag match
Replace in current file
Search and replace in the active editor.
OpenIn sheettext1 tag match
Find trailing whitespace
Match spaces at end of lines.
OpenIn sheetregex1 tag match