Skip to content

Instantly share code, notes, and snippets.

@thamas
Last active December 19, 2015 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thamas/5927613 to your computer and use it in GitHub Desktop.
Save thamas/5927613 to your computer and use it in GitHub Desktop.
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