Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-12-31 20:22
Flavor·ECMAScript (JavaScript)

/
^ +|( )(?=\1)| +$
/
g
Open regex in editor

Description

'test' - no match 'test test' - no match ' test' - match (space at the start) 'test ' - match (space at the end) 'test test' - match (single space in the middle)

Submitted by J. Harry B.