Regular Expressions 101

Community Patterns

123...6

Community Library Entry

107

Regular Expression
ECMAScript (JavaScript)

/
^[ \t]+|[ \t]+$
/
gm

Description

Trim leading and trailing whitespace from a string.

Submitted by fp - 11 years ago (Last modified 3 months ago)