Community Patterns

Community Library Entry

1

Regular Expression
Created·2014-08-12 13:45
Flavor·PCRE (Legacy)

/
^[ \s\0\x0B]+|[ \s\0\x0B]+$
/
gm
Open regex in editor

Description

Popular trim Regular Expression.

Matches whitespace characters at the beginning and end of a string.

Check out the usage examples in the test string to see how you can implement it into your own code.

Submitted by Shawn G.