Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?<line>[\s\S]{0,80})(?<=(?<last_space_on_line>[\x20]))
/
gmi

Description

Lookup for last space on a specified linewidth (e.g. 80 chars) and insert a newline.

Submitted by mr-craps - 4 years ago (Last modified 3 years ago)