Regular Expressions 101

Community Patterns

1...34567...902

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

Description

string = string.replace(/ +/g," "); for just spaces OR

string = string.replace(/(\s)+/g,"$1"); for turning multiple returns into a single return also.

Submitted by anonymous - 6 years ago