Sublime Forum

Regex: Add new empty line

#1

hello. Can anybody help me?

I need to add a new empty line before and after a particular word or words. For example:

I love songs, my mother loves cats. WORD_1 sentence bla bla.. WORD_2 bla bla...

I need to add a new empty line before WORD_1 and a new empty line after WORD_2.

Can anyone help me please?

0 Likes

#2
  1. Enable the regex option
  2. Search for WORD1 and replace by \nWORD1\n
0 Likes

#3

hello, thanks. Works, but doesn’t add a new empty line, it just put the word on the new line. I need a space (an empty line) between First sentence and WORD_1 or WORD_2

0 Likes

#4

You mean this \n\nWORD1\n?

See:

  1. http://www.rexegg.com/regex-quickstart.html#chars
0 Likes

#5

super, thanks a lot !!

1 Like