Regular Expressions 101

  • PCRE (Legacy)
  • Match
1

Regular Expression

/
^[ \s\0\x0B]+|[ \s\0\x0B]+$
/
gm

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.