Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sublime regexp remove newlines

Using Sublime Text's Replace function with regex

Remove newlines from paragraph:

Changes this:

"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment.

So blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail."

To this:

"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment.

So blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail."

Find What:

([\w\X\.,?!])\n([\w\X])

Replace With:

\1 \2

Regexp by @tikaszvince. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment