Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 619
abhijit Avatar asked Sep 15 '12 12:09

abhijit


1 Answers

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

like image 196
Riccardo Marotti Avatar answered Sep 26 '22 21:09

Riccardo Marotti