Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
^\s*(.*?)\s*$
/
gm

Description

Trim leading/trailing space on a string: do not use /gm flags.

Trim each line of a multiline string: use the /gm flag.

Submitted by https://github.com/naomik - 11 years ago