abhijit
abhijit

Reputation: 1968

Sublime Text Search and Insert Content within Quotes

Original:

description: Hello World
description: Hello India
description: Hello Guys

I have 20000 lines of this in a yaml file, i want to search and put the content of description in double quotes, the content of description varies every line

I want:

description: "Hello World"
description: "Hello India"
description: "Hello Guys"

So is this thing doable, if yes, then can you suggest me how?

Thanks.

Upvotes: 7

Views: 3574

Answers (1)

Riccardo Marotti
Riccardo Marotti

Reputation: 20348

You can use a regular expression with find and replace (menu: find/replace). In the find box type:

description: (.*)

In the replace box:

description: "$1"

Then press replace.

Remember to select the "regular expression" box:

enter image description here

Upvotes: 15

Related Questions