Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-06-20 12:23
Flavor·PCRE (Legacy)

/
^[\s;]+(?<![^\s;])|(?<=;)[\s;]*|(?<=[^\s;])\s*|(?![^\s;])[\s;]+$
/
gm
Open regex in editor

Description

cleans up a semicolon delimited list (remove white spaces, multiple semicolons, semicolons at the beginning or the end)

Submitted by anonymous