How to add line breaks in Google Docs find and replace function?

I’m trying to use Google Docs find and replace feature to change single lines into two lines. For example:

Original: Hello world
Desired: Hello
         world

I’ve tried using \n in the replace box but it just adds the characters instead of a real line break. I also attempted using regex with parentheses and $1 but no luck.

Is there a way to do this in Google Docs or do I need to use a different word processor? Any tips or tricks would be really helpful. Thanks!

I’ve encountered this issue before, and it’s indeed frustrating. While Google Docs lacks advanced find-and-replace capabilities, there’s a workaround that might help. Try using Google Sheets instead. Copy your text into a spreadsheet, use find-and-replace there (Sheets recognizes ‘\n’ as a line break), then copy the result back to Docs. It’s not perfect, but it’s quicker than manual editing for large documents. Alternatively, consider using a macro-enabled word processor like LibreOffice Writer, which offers more powerful find-and-replace options. These solutions aren’t ideal, but they can save time compared to manual editing in Google Docs.

As someone who’s worked extensively with Google Docs, I can tell you that unfortunately, its find and replace function is quite limited when it comes to line breaks. I’ve faced this issue many times, and the workaround I’ve found most effective is to use a two-step process.

First, replace your target text with a unique placeholder string, like ‘###’. Then, do a second find and replace, searching for ‘###’ and replacing it with a line break by pressing Enter in the ‘Replace with’ field.

It’s not ideal, but it gets the job done. For more complex formatting needs, I’ve sometimes had to resort to using a script or switching to a more powerful word processor like Microsoft Word. Google Docs is great for collaboration, but it does have its limitations in text manipulation.

hey there! unfortunately google docs doesnt have a straightforward way to do this :frowning: what i usually do is replace the word with something unique like ‘@@’ then manually go thru and hit enter after each one. its a bit tedious but works. hope that helps!