Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-08-23 14:53
Flavor·ECMAScript (JavaScript)

/
^\s+|\s+$|\s+(?=\s)
/
gm
Open regex in editor

Description

Get rid of initial, trailing spaces, and extra middle spaces (more than one space in the middle of a string)

Submitted by anonymous