regex

Regex Search Lines Add Quotes

Regex to search a whole file and if the line contains the search word, add beginning and ending quotes. I in this case doing it vi(m). This works to add beginning and ending quotes to ALL lines in the file **:%s/^(.*)$/\\1/** or simpler **:%s/.*/&** Explanation: By default, a pattern is…