Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?<![\.\n]) ?\n(?!\n)
/
gsm

Description

Intended as a first pass on already word wrapped text, to remove wrap newlines while preserving likely intentional ones.

Not especially robust.

Submitted by Tristan - 3 years ago