Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(.)\1*([\w\W]+?)(.)\3*(?!\3)$
/
gmi

Description

Trim repeating characters at start and end, e.g. "//strip me$$" becomes "/strip me$"

Submitted by anonymous - 6 years ago