Regular Expressions 101

Community Patterns

Selector Trim Matcher (jQuery)

0

Regular Expression
ECMAScript (JavaScript)

/
^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$
/
gm

Description

The regular expression used in the jQuery library to match characters that should be trimmed from selector strings.

Submitted by Ben - 3 years ago