Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?<!\s)(\s)(?:\S+?)(?:\r\n?|\n|\z)
/
g

Description

Looks for the last single space in a line of text.

Submitted by anonymous - 7 years ago