Regular Expressions 101

Community Patterns

1...34567...744

Delete spaces at beginning or end of a string

0

Regular Expression
PCRE (PHP <7.3)

/
(^[ ]{1,})|([ ]{1,}$)
/
gm

Description

Delete spaces at beginning or end of a string

Submitted by anonymous - 2 years ago