Regular Expressions 101

Community Patterns

ECMAScript/JavaScript trim

106

Regular Expression
ECMAScript (JavaScript)

/
^[\s]*(.*?)[\s]*$
/

Description

Trim leading and trailing whitespace from a string.

Submitted by fp - 11 years ago (Last modified 2 days ago)