Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(?=^\s*([\S\s]+?)\s*$)
/

Description

Trims a string without selecting any unnecessary text.

Submitted by Vihan Bhargava - 9 years ago