How do I fix this with 'find & replace' on MS Word

I scrape information from certain websites and would like to remove some paragraph breaks when I paste it. The information is then pasted as such:

Text

paragraph break (x2)

Text

paragraph break (x2)

Text

paragraph break (x4)

Text

paragraph break (x19)

Text (rinse & repeat)

How do I fix this? I know I need to replace ^p with nothing to erase individual paragraph breaks, but it becomes complex when the paragraph breaks are not consistent. Help appreciated.


Solution 1:

Use wildcard.

Find what:

  • All paragraph breaks: (^13)\1@

  • All line breaks: (^l)\1@

  • Mixed: [^l^13]{2,}

Replace with: ^p

break Normal Wildcard
paragraph break ^p ^13
line break ^l ^l

Find and Replace Dialogue Example