Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-07-03 11:00
Flavor·PCRE (Legacy)

/
([^\n])\n(?=[^\n])
/
gm
Open regex in editor

Description

In the first capturing group, match any character that isn't a newline, then, match a newline, then, in a non-capturing group, match a newline. Replace the the entire matched sequence with contents of the first capturing group followed by a space.

Submitted by anonymous